public class Variable
extends org.apache.tools.ant.Task
This used to be a nice little task that took advantage of what is probably a flaw in the Ant Project API -- setting a "user" property programatically causes the project to overwrite a previously set property. Now this task has become more violent and employs a technique known as "object rape" to directly access the Project's private property hashtable.
Developed for use with Antelope, migrated to ant-contrib Oct 2003.
| Constructor and Description |
|---|
Variable() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addProperties(java.util.Properties props)
iterate through a set of properties, resolve them, then assign them
|
void |
execute()
Execute this task.
|
void |
setFile(java.io.File file)
Set the name of a file to read properties from.
|
void |
setName(java.lang.String name)
Set the name of the property.
|
void |
setUnset(boolean b)
Determines whether the property should be removed from the project.
|
void |
setValue(java.lang.String value)
Set the value of the property.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void setName(java.lang.String name)
name - the name of the property.public void setValue(java.lang.String value)
value - the value of the property.public void setFile(java.io.File file)
file - the file to read properties from.public void setUnset(boolean b)
b - set to true to remove the property from the project.public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - Description of the Exceptionprotected void addProperties(java.util.Properties props)
props - The feature to be added to the Properties attribute