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:
Cloneable
,Comparable<Resource>
,Iterable<Resource>
,ResourceCollection
Exposes an Ant property as a Resource.
- Since:
- Ant 1.7
-
Field Summary
Fields inherited from class org.apache.tools.ant.types.Resource
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
ConstructorDescriptionDefault constructor.PropertyResource
(Project p, String n) Construct a new PropertyResource with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Override to implement equality with equivalent Resources, since we are capable of proxying them.Get an InputStream for the Resource.Get the Object value of this PropertyResource.Get an OutputStream for the Resource.protected PropertyResource
getRef()
Perform the check for circular references and return the referenced Resource.protected Resource
Get the referenced or proxied Resource, if applicable.long
getSize()
Get the size of this Resource.getValue()
Get the value of this PropertyResource.int
hashCode()
Get the hash code for this Resource.boolean
isExists()
Find out whether this Resource exists.protected boolean
Learn whether this PropertyResource either refers to another Resource or proxies another Resource due to its object property value being said Resource.toString()
Get the string representation of this Resource.Methods inherited from class org.apache.tools.ant.types.Resource
as, 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.DataType
checkAttributesAllowed, 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.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.apache.tools.ant.types.ResourceCollection
isEmpty, stream
-
Constructor Details
-
PropertyResource
public PropertyResource()Default constructor. -
PropertyResource
-
-
Method Details
-
getValue
Get the value of this PropertyResource.- Returns:
- the value of the specified Property.
-
getObjectValue
Get the Object value of this PropertyResource.- Returns:
- the Object value of the specified Property.
- Since:
- Ant 1.8.1
-
isExists
-
getSize
-
equals
-
hashCode
-
toString
-
getInputStream
Get an InputStream for the Resource.- Overrides:
getInputStream
in classResource
- 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.
-
getOutputStream
Get an OutputStream for the Resource.- Overrides:
getOutputStream
in classResource
- 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.
-
isReferenceOrProxy
protected 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
-
getReferencedOrProxied
Get the referenced or proxied Resource, if applicable.- Returns:
- Resource
- Throws:
IllegalStateException
- if this PropertyResource neither proxies nor references another Resource.
-
getRef
Description copied from class:Resource
Perform the check for circular references and return the referenced Resource.
-