Class PropertyResource
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.types.DataType
- 
- org.apache.tools.ant.types.Resource
- 
- org.apache.tools.ant.types.resources.PropertyResource
 
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- java.lang.Comparable<Resource>,- java.lang.Iterable<Resource>,- ResourceCollection
 
 public class PropertyResource extends Resource Exposes an Ant property as a Resource.- Since:
- Ant 1.7
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.types.ResourceMAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
 - 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description PropertyResource()Default constructor.PropertyResource(Project p, java.lang.String n)Construct a new PropertyResource with the specified name.
 - 
Method SummaryModifier and Type Method Description booleanequals(java.lang.Object o)Override to implement equality with equivalent Resources, since we are capable of proxying them.java.io.InputStreamgetInputStream()Get an InputStream for the Resource.java.lang.ObjectgetObjectValue()Get the Object value of this PropertyResource.java.io.OutputStreamgetOutputStream()Get an OutputStream for the Resource.protected PropertyResourcegetRef()Perform the check for circular references and return the referenced Resource.protected ResourcegetReferencedOrProxied()Get the referenced or proxied Resource, if applicable.longgetSize()Get the size of this Resource.java.lang.StringgetValue()Get the value of this PropertyResource.inthashCode()Get the hash code for this Resource.booleanisExists()Find out whether this Resource exists.protected booleanisReferenceOrProxy()Learn whether this PropertyResource either refers to another Resource or proxies another Resource due to its object property value being said Resource.java.lang.StringtoString()Get the string representation of this Resource.- 
Methods inherited from class org.apache.tools.ant.types.Resourceas, asOptional, clone, compareTo, getLastModified, getMagicNumber, getName, isDirectory, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setRefid, setSize, size, toLongString
 - 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
 
- 
 
- 
- 
- 
Constructor Detail- 
PropertyResourcepublic PropertyResource() Default constructor.
 - 
PropertyResourcepublic PropertyResource(Project p, java.lang.String n) Construct a new PropertyResource with the specified name.- Parameters:
- p- the project to use.
- n- the String name of this PropertyResource (Ant property name/key).
 
 
- 
 - 
Method Detail- 
getValuepublic java.lang.String getValue() Get the value of this PropertyResource.- Returns:
- the value of the specified Property.
 
 - 
getObjectValuepublic java.lang.Object getObjectValue() Get the Object value of this PropertyResource.- Returns:
- the Object value of the specified Property.
- Since:
- Ant 1.8.1
 
 - 
isExistspublic boolean isExists() Find out whether this Resource exists.
 - 
getSizepublic long getSize() Get the size of this Resource.
 - 
equalspublic boolean equals(java.lang.Object o) Override to implement equality with equivalent Resources, since we are capable of proxying them.
 - 
hashCodepublic int hashCode() Get the hash code for this Resource.
 - 
toStringpublic java.lang.String toString() Get the string representation of this Resource.
 - 
getInputStreampublic java.io.InputStream getInputStream() throws java.io.IOExceptionGet an InputStream for the Resource.- Overrides:
- getInputStreamin class- Resource
- Returns:
- an InputStream containing this Resource's content.
- Throws:
- java.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.
 
 - 
getOutputStreampublic java.io.OutputStream getOutputStream() throws java.io.IOExceptionGet an OutputStream for the Resource.- Overrides:
- getOutputStreamin class- Resource
- Returns:
- an OutputStream to which content can be written.
- Throws:
- java.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.
 
 - 
isReferenceOrProxyprotected boolean isReferenceOrProxy() Learn whether this PropertyResource either refers to another Resource or proxies another Resource due to its object property value being said Resource.- Returns:
- boolean
 
 - 
getReferencedOrProxiedprotected Resource getReferencedOrProxied() Get the referenced or proxied Resource, if applicable.- Returns:
- Resource
- Throws:
- java.lang.IllegalStateException- if this PropertyResource neither proxies nor references another Resource.
 
 - 
getRefprotected PropertyResource getRef() Description copied from class:ResourcePerform the check for circular references and return the referenced Resource.
 
- 
 
-