org.apache.tools.ant.types.resources
public class StringResource extends Resource
Since: Ant 1.7
Constructor Summary | |
---|---|
StringResource()
Default constructor. | |
StringResource(String value)
Construct a StringResource with the supplied value. |
Method Summary | |
---|---|
protected String | getContent()
Get the content of this StringResource. |
String | getEncoding()
Get the encoding used by this StringResource. |
InputStream | getInputStream()
Get an InputStream for the Resource. |
String | getName()
Synchronize access. |
OutputStream | getOutputStream()
Get an OutputStream for the Resource. |
long | getSize()
Get the size of this Resource. |
String | getValue()
Get the value of this StringResource. |
int | hashCode()
Get the hash code for this Resource. |
void | setEncoding(String s)
Set the encoding to be used for this StringResource. |
void | setName(String s)
Enforce String immutability. |
void | setRefid(Reference r)
Overrides the super version. |
void | setValue(String s)
The value attribute is a semantically superior alias for the name attribute. |
String | toString()
Get the string.
|
Parameters: value the value of this StringResource.
Returns: a String; if the Project has been set properties replacement will be attempted.
Returns: the encoding name.
Returns: an InputStream containing this Resource's content.
Throws: IOException if unable to provide the content of this Resource as a stream. UnsupportedOperationException if InputStreams are not supported for this Resource type.
Returns: the name/value of this StringResource.
Returns: an OutputStream to which content can be written.
Throws: IOException if unable to provide the content of this Resource as a stream. UnsupportedOperationException if OutputStreams are not supported for this Resource type.
Returns: the size, as a long, 0 if the Resource does not exist (for compatibility with java.io.File), or UNKNOWN_SIZE if not known.
Returns: the represented String.
Returns: hash code as int.
Parameters: s the encoding name.
Parameters: s the new name/value for this StringResource.
Parameters: r the Reference to set.
Parameters: s the String's value.
Returns: the string contents of the resource.
Since: Ant 1.7