Package scriptella.configuration
Class StringResource
java.lang.Object
scriptella.configuration.StringResource
- All Implemented Interfaces:
Resource
Represents String as a resource.
This implementation is intended to represent small text blocks.
This resource is immutable and can be cached based on object identity.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Constructor Summary
ConstructorsConstructorDescriptionStringResource(String string) Creates a resource based on String content.StringResource(String string, String description) Creates a resource based on String content. -
Method Summary
-
Constructor Details
-
StringResource
Creates a resource based on String content.- Parameters:
string- resource content.
-
StringResource
Creates a resource based on String content.- Parameters:
string- resource content.description- resource description.
-
-
Method Details
-
open
Description copied from interface:ResourceOpens a resource and returns a content reader.The returned reader implementation should be effective enough to allow usage without extra buffering, etc.
- Specified by:
openin interfaceResource- Returns:
- resource content reader
- Throws:
IOException- if I/O error occurs.
-
getString
Returns the string wrapped by this resource. -
toString
-