|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.builder.xml.XPathBuilder<E>
public class XPathBuilder<E extends Exchange>
Creates an XPath expression builder
Constructor Summary | |
---|---|
XPathBuilder(String text)
|
Method Summary | |
---|---|
void |
assertMatches(String text,
E exchange)
Allows this predicate to be used nicely in testing to generate a nicely formatted exception and message if this predicate does not match for the given exchange. |
XPathBuilder<E> |
booleanResult()
Sets the expression result type to boolean |
protected XPathExpression |
createXPathExpression()
|
Object |
evaluate(E exchange)
Returns the value of the expression on the given exchange |
protected Object |
evaluateAs(E exchange,
QName resultType)
Evaluates the expression as the given result type |
XPathBuilder<E> |
functionResolver(XPathFunctionResolver functionResolver)
Sets the XPathFunctionResolver instance to use on these XPath expressions |
protected Object |
getDocument(E exchange)
Strategy method to extract the document from the exchange |
Class |
getDocumentType()
|
XPathExpression |
getExpression()
|
XPathFunctionResolver |
getFunctionResolver()
|
DefaultNamespaceContext |
getNamespaceContext()
|
QName |
getResultType()
|
String |
getText()
|
XPathFactory |
getXPathFactory()
|
boolean |
matches(E exchange)
Evaluates the predicate on the message exchange and returns true if this exchange matches the predicate |
XPathBuilder<E> |
namespace(String prefix,
String uri)
Registers the namespace prefix and URI with the builder so that the prefix can be used in XPath expressions |
XPathBuilder<E> |
nodeResult()
Sets the expression result type to boolean |
XPathBuilder<E> |
nodeSetResult()
Sets the expression result type to boolean |
XPathBuilder<E> |
numberResult()
Sets the expression result type to boolean |
XPathBuilder<E> |
objectModel(String uri)
Sets the object model URI to use |
void |
setDocumentType(Class documentType)
|
void |
setFunctionResolver(XPathFunctionResolver functionResolver)
|
void |
setNamespaceContext(DefaultNamespaceContext namespaceContext)
|
void |
setNamespacesFromDom(Element node)
|
void |
setXPathFactory(XPathFactory xpathFactory)
|
XPathBuilder<E> |
stringResult()
Sets the expression result type to boolean |
String |
toString()
|
XPathBuilder<E> |
variable(String name,
Object value)
Registers a variable (in the global namespace) which can be referred to from XPath expressions |
static XPathBuilder |
xpath(String text)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XPathBuilder(String text)
Method Detail |
---|
public static XPathBuilder xpath(String text)
public String toString()
toString
in class Object
public boolean matches(E exchange)
Predicate
matches
in interface Predicate<E extends Exchange>
exchange
- the message exchange
public void assertMatches(String text, E exchange) throws AssertionError
Predicate
assertMatches
in interface Predicate<E extends Exchange>
text
- the description to use in the exception messageexchange
- the exchange to evaluate the expression on
AssertionError
- if the predicate does not matchpublic Object evaluate(E exchange)
Expression
evaluate
in interface Expression<E extends Exchange>
exchange
- the message exchange on which to evaluate the expression
public XPathBuilder<E> booleanResult()
public XPathBuilder<E> nodeResult()
public XPathBuilder<E> nodeSetResult()
public XPathBuilder<E> numberResult()
public XPathBuilder<E> stringResult()
public XPathBuilder<E> objectModel(String uri)
public XPathBuilder<E> functionResolver(XPathFunctionResolver functionResolver)
XPathFunctionResolver
instance to use on these XPath expressions
public XPathBuilder<E> namespace(String prefix, String uri)
prefix
- is the namespace prefix that can be used in the XPath expressionsuri
- is the namespace URI to which the prefix refers
public XPathBuilder<E> variable(String name, Object value)
public XPathFactory getXPathFactory() throws XPathFactoryConfigurationException
XPathFactoryConfigurationException
public void setXPathFactory(XPathFactory xpathFactory)
public Class getDocumentType()
public void setDocumentType(Class documentType)
public String getText()
public QName getResultType()
public DefaultNamespaceContext getNamespaceContext()
public void setNamespaceContext(DefaultNamespaceContext namespaceContext)
public XPathFunctionResolver getFunctionResolver()
public void setFunctionResolver(XPathFunctionResolver functionResolver)
public XPathExpression getExpression() throws XPathFactoryConfigurationException, XPathExpressionException
XPathFactoryConfigurationException
XPathExpressionException
public void setNamespacesFromDom(Element node)
protected Object evaluateAs(E exchange, QName resultType)
protected XPathExpression createXPathExpression() throws XPathExpressionException, XPathFactoryConfigurationException
XPathExpressionException
XPathFactoryConfigurationException
protected Object getDocument(E exchange)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |