org.apache.tools.ant.types.resources
Class StringResource
- Cloneable, Comparable, ResourceCollection
public class StringResource
Exposes a string as a Resource.
StringResource()- Default constructor.
|
StringResource(String value)- Construct a StringResource with the supplied value.
|
StringResource(Project project, String value)- Construct a StringResource with the supplied project and value,
doing property replacement against the project if non-null.
|
void | addText(String text)- Add nested text to this resource.
|
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, resolving to the root reference if needed.
|
int | hashCode()- Get the hash code for this Resource.
|
boolean | isExists()- The exists attribute tells whether a resource exists.
|
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.
|
clone, compareTo, equals, getInputStream, getLastModified, getMagicNumber, getName, getOutputStream, getSize, hashCode, isDirectory, isExists, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setRefid, setSize, size, toLongString, toString |
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes |
StringResource
public StringResource()
Default constructor.
StringResource
public StringResource(String value)
Construct a StringResource with the supplied value.
value - the value of this StringResource.
StringResource
public StringResource(Project project,
String value) Construct a StringResource with the supplied project and value,
doing property replacement against the project if non-null.
project - the owning Project.value - the value of this StringResource.
addText
public void addText(String text)
Add nested text to this resource.
Properties will be expanded during this process.
text - text to use as the string resource
getContent
protected String getContent()
Get the content of this StringResource. See
getValue()
- a String or null if there is no value.
getEncoding
public String getEncoding()
Get the encoding used by this StringResource.
getInputStream
public InputStream getInputStream()
throws IOException Get an InputStream for the Resource.
- getInputStream in interface Resource
- an InputStream containing this Resource's content.
getName
public String getName()
Synchronize access.
- getName in interface Resource
- the name/value of this StringResource.
getOutputStream
public OutputStream getOutputStream()
throws IOException Get an OutputStream for the Resource.
- getOutputStream in interface Resource
- an OutputStream to which content can be written.
getSize
public long getSize()
Get the size of this Resource.
- getSize in interface Resource
- the size, as a long, 0 if the Resource does not exist (for
compatibility with java.io.File), or UNKNOWN_SIZE if not known.
getValue
public String getValue()
Get the value of this StringResource, resolving to the root reference if needed.
hashCode
public int hashCode()
Get the hash code for this Resource.
- hashCode in interface Resource
isExists
public boolean isExists()
The exists attribute tells whether a resource exists.
- isExists in interface Resource
- true if this resource exists.
setEncoding
public void setEncoding(String s)
Set the encoding to be used for this StringResource.
setName
public void setName(String s)
Enforce String immutability.
- setName in interface Resource
s - the new name/value for this StringResource.
setRefid
public void setRefid(Reference r)
Overrides the super version.
- setRefid in interface Resource
r - the Reference to set.
setValue
public void setValue(String s)
The value attribute is a semantically superior alias for the name attribute.
toString
public String toString()
- toString in interface Resource
- the string contents of the resource.