public class StringSource extends java.lang.Object implements Source
CharSequence as a source.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
content |
private java.lang.String |
location |
| Constructor and Description |
|---|
StringSource(java.lang.CharSequence content)
Creates a new source backed by the specified string.
|
StringSource(java.lang.CharSequence content,
java.lang.String location)
Creates a new source backed by the specified string.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContent()
Gets the content of this source.
|
java.io.InputStream |
getInputStream()
Gets a byte stream to the source contents.
|
java.lang.String |
getLocation()
Provides a user-friendly hint about the location of the source.
|
java.lang.String |
toString() |
public StringSource(java.lang.CharSequence content)
content - The String representation, may be empty or null.public StringSource(java.lang.CharSequence content,
java.lang.String location)
content - The String representation, may be empty or null.location - The location to report for this use, may be null.public java.io.InputStream getInputStream()
throws java.io.IOException
SourcegetInputStream in interface Sourcenull.java.io.IOExceptionpublic java.lang.String getLocation()
SourcegetLocation in interface Sourcenull.public java.lang.String getContent()
null.public java.lang.String toString()
toString in class java.lang.Object