public class StringSource extends Object implements Source
CharSequence
as a source.Constructor and Description |
---|
StringSource(CharSequence content)
Creates a new source backed by the specified string.
|
StringSource(CharSequence content,
String location)
Creates a new source backed by the specified string.
|
Modifier and Type | Method and Description |
---|---|
String |
getContent()
Gets the content of this source.
|
InputStream |
getInputStream()
Gets a byte stream to the source contents.
|
String |
getLocation()
Provides a user-friendly hint about the location of the source.
|
String |
toString() |
public StringSource(CharSequence content)
content
- The String representation, may be empty or null
.public StringSource(CharSequence content, String location)
content
- The String representation, may be empty or null
.location
- The location to report for this use, may be null
.public InputStream getInputStream() throws IOException
Source
getInputStream
in interface Source
null
.IOException
public String getLocation()
Source
getLocation
in interface Source
null
.public String getContent()
null
.Copyright © 2001–2023 The Apache Software Foundation. All rights reserved.