|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.technicolor.eloyente.XPathExpressionHandler
public class XPathExpressionHandler
This is a convenience class for working with XPath expressions.
It is used in ElOyente for filters and for environment variables, based on XMPP events. XMPP events are XML messages, and a filters uses the test() function of this class to check whether the XMPP event should trigger a Jenkins job. The evaluate() function at the other hand will be used to extract data from the XMPP event, and to store it in environment variables, such that the Jenkins job which is triggered by the event can use the data.
| Constructor Summary | |
|---|---|
XPathExpressionHandler()
Default constructor |
|
XPathExpressionHandler(String expression)
Constructor which configures an expression |
|
| Method Summary | |
|---|---|
String |
evaluate(String xml)
Evaluate the expression |
String |
getExpression()
Function to retrieve the expression |
void |
setExpression(String expression)
Function to change the expression |
boolean |
test(String xml)
Test the expression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XPathExpressionHandler()
throws XPathExpressionException
Creates an XPathExpression handler with an empty expression.
XPathExpressionException
public XPathExpressionHandler(String expression)
throws XPathExpressionException
expression - An expression in XPath notation
XPathExpressionException| Method Detail |
|---|
public void setExpression(String expression)
throws XPathExpressionException
expression - An expression in XPath notation.
XPathExpressionExceptionpublic String getExpression()
public String evaluate(String xml)
throws XPathExpressionException
This function evaluates the expression against the provided XML document and returns the result as a string.
xml - The XML document to evaluate
XPathExpressionException
public boolean test(String xml)
throws XPathExpressionException
This function evaluates the expression against the provided XML document and returns true if the expression result is not empty.
xml - The XML document to evaluate
XPathExpressionException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||