|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.XmlProperty
Loads property values from a valid XML file, generating the property names from the file's element and attribute names. Example:
<root-tag myattr="true"> <inner-tag someattr="val">Text</inner-tag> <a2><a3><a4>false</a4></a3></a2> </root-tag>this generates
root-tag(myattr)=true root-tag.inner-tag=Text root-tag.inner-tag(someattr)=val root-tag.a2.a3.a4=false
Field Summary |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
XmlProperty()
Constructor. |
Method Summary | |
void |
execute()
Run the task. |
void |
init()
Initializes the task. |
void |
setCollapseAttributes(boolean collapseAttributes)
flag to treat attributes as nested elements; optional, default false |
void |
setFile(java.io.File src)
The XML file to parse; required. |
void |
setKeeproot(boolean keepRoot)
flag to include the xml root tag as a first value in the property name; optional, default is true |
void |
setPrefix(java.lang.String prefix)
the prefix to prepend to each property |
void |
setValidate(boolean validate)
flag to validate the XML file; optional, default false |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlProperty()
Method Detail |
public void init()
init
in class Task
public void execute() throws BuildException
execute
in class Task
BuildException
- The exception raised during task execution.public void setFile(java.io.File src)
public void setPrefix(java.lang.String prefix)
public void setKeeproot(boolean keepRoot)
public void setValidate(boolean validate)
public void setCollapseAttributes(boolean collapseAttributes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |