|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.cruisecontrol.util.XPathAwareChild
This class represents a plugin subelement that returns either a fixed value or uses an xpath expression to retrieve a value from an XML document. Instances of this class represent an element that has either a fixed value, e.g.
<mychild value="foo"/>
or one that has an xpath expression that will be executed against CruiseControl's log file at execution time, e.g.
<mychild xpathExpression="sum(cruisecontrol/testsuite/@tests)"/>
or one that has an xpath expression that will be executed against a named xml file at execution time, e.g.
<mychild xpathExpression="sum(cruisecontrol/testsuite/@tests)" xmlFile="/path/to/my/xml/file"/>For example usage in a plugin, see
SfeeDocumentManagerPublisher.createDescription()
.
SfeeDocumentManagerPublisher
Constructor Summary | |
XPathAwareChild()
|
Method Summary | |
java.lang.String |
getFixedValue()
|
java.lang.String |
getXpathExpression()
|
java.lang.String |
lookupValue(org.jdom.Element log)
Looks up the appropriate value based on how the class is being used. |
protected void |
markDirty()
Called to indicate that this classs needs to be validated, as after a change to a member variable. |
void |
setInputStream(java.io.InputStream in)
Used for testing. |
void |
setValue(java.lang.String value)
If this value is set, then it is considered to be a "fixed" value that will be returned by the lookupValue method. |
void |
setXMLFile(java.lang.String filename)
|
void |
setXPathExpression(java.lang.String xpathExpression)
|
void |
validate()
Must be called after setting all the instance values and before calling lookupValue . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XPathAwareChild()
Method Detail |
public void setValue(java.lang.String value)
lookupValue
method. If this is set, then xpathExpression
and xmlFile
should NOT be set.
public void setXPathExpression(java.lang.String xpathExpression)
public void setInputStream(java.io.InputStream in)
public void setXMLFile(java.lang.String filename)
public java.lang.String getFixedValue()
public java.lang.String getXpathExpression()
public java.lang.String lookupValue(org.jdom.Element log) throws CruiseControlException
CruiseControlException
public void validate() throws CruiseControlException
lookupValue
.
CruiseControlException
protected void markDirty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |