|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.jcoderz.commons.taskdefs.XpathPropertyTask
public class XpathPropertyTask
This task allows to set a property based on an xpath expression, evaluated on a given xml file.
The tasks needs 3 properties to be set:
namefilexpathThe task can be defined using the following taskdef:
<taskdef name="xpathproperty"
classname="org.jcoderz.commons.taskdefs.XpathPropertyTask"
classpath="fawkez-all.jar"/>
A possible use would be:
<xpathproperty
name="xpathtest"
xpath="/project/@name"
file="build.xml"/>
Which would set the property xpathtest to fawkeZ
is applied to the fawkez build.xml.
The task requires java5 to function properly.
| Field Summary | |
|---|---|
static String |
NAME
Task name. |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
XpathPropertyTask()
|
|
| Method Summary | |
|---|---|
void |
execute()
Perform the evaluation. |
void |
setFile(File xmlFile)
Set the file to be parsed. |
void |
setName(String name)
Set the name of the property to be set. |
void |
setXpath(String xpath)
Set the xpath expression to be evaluated. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NAME
| Constructor Detail |
|---|
public XpathPropertyTask()
| Method Detail |
|---|
public void setFile(File xmlFile)
xmlFile - the file to be parsed.public void setXpath(String xpath)
xpath - the xpath expression to be evaluated.public void setName(String name)
name - the name of the property to be set.public void execute()
execute in class org.apache.tools.ant.Task
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||