public class StringResource extends java.lang.Object implements Resource
This implementation is intended to represent small text blocks.
This resource is immutable and can be cached based on object identity.
Constructor and Description |
---|
StringResource(java.lang.String string)
Creates a resource based on String content.
|
StringResource(java.lang.String string,
java.lang.String description)
Creates a resource based on String content.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getString()
Returns the string wrapped by this resource.
|
java.io.Reader |
open()
Opens a resource and returns a content reader.
|
java.lang.String |
toString() |
public StringResource(java.lang.String string)
string
- resource content.public StringResource(java.lang.String string, java.lang.String description)
string
- resource content.description
- resource description.public java.io.Reader open() throws java.io.IOException
Resource
The returned reader implementation should be effective enough to allow usage without extra buffering, etc.
public java.lang.String getString()
Copyright © Copyright 2006-2019 The Scriptella Project Team.