java.lang.Cloneable, java.lang.Comparable<Resource>, java.lang.Iterable<Resource>, ResourceCollectionpublic class StringResource extends Resource
description, location, projectMAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE| Constructor | Description |
|---|---|
StringResource() |
Default constructor.
|
StringResource(java.lang.String value) |
Construct a StringResource with the supplied value.
|
StringResource(Project project,
java.lang.String value) |
Construct a StringResource with the supplied project and value,
doing property replacement against the project if non-null.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addText(java.lang.String text) |
Add nested text to this resource.
|
protected StringResource |
getCheckedRef() |
Performs the check for circular references and returns the
referenced object.
|
protected java.lang.String |
getContent() |
Get the content of this StringResource.
|
java.lang.String |
getEncoding() |
Get the encoding used by this StringResource.
|
java.io.InputStream |
getInputStream() |
Get an InputStream for the Resource.
|
java.lang.String |
getName() |
Synchronize access.
|
java.io.OutputStream |
getOutputStream() |
Get an OutputStream for the Resource.
|
long |
getSize() |
Get the size of this Resource.
|
java.lang.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(java.lang.String s) |
Set the encoding to be used for this StringResource.
|
void |
setName(java.lang.String s) |
Enforce String immutability.
|
void |
setRefid(Reference r) |
Overrides the super version.
|
void |
setValue(java.lang.String s) |
The value attribute is a semantically superior alias for the name attribute.
|
java.lang.String |
toString() |
Get the string.
|
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributesfinalize, getClass, notify, notifyAll, wait, wait, waitgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectas, asOptional, clone, compareTo, equals, getLastModified, getMagicNumber, isDirectory, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setSize, size, toLongStringisEmpty, streampublic StringResource()
public StringResource(java.lang.String value)
value - the value of this StringResource.public StringResource(Project project, java.lang.String value)
project - the owning Project.value - the value of this StringResource.public void setName(java.lang.String s)
public void setValue(java.lang.String s)
s - the String's value.public java.lang.String getName()
public java.lang.String getValue()
public boolean isExists()
public void addText(java.lang.String text)
text - text to use as the string resourcepublic void setEncoding(java.lang.String s)
s - the encoding name.public java.lang.String getEncoding()
public long getSize()
public int hashCode()
public java.lang.String toString()
getContent()public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class Resourcejava.io.IOException - if unable to provide the content of this
Resource as a stream.java.lang.UnsupportedOperationException - if InputStreams are not
supported for this Resource type.public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class Resourcejava.io.IOException - if unable to provide the content of this
Resource as a stream.java.lang.UnsupportedOperationException - if OutputStreams are not
supported for this Resource type.public void setRefid(Reference r)
protected java.lang.String getContent()
getValue()protected StringResource getCheckedRef()
DataTypegetCheckedRef in class Resource