Package org.apache.camel.model.language
Class XPathExpression
- java.lang.Object
-
- org.apache.camel.model.language.ExpressionDefinition
-
- org.apache.camel.model.language.NamespaceAwareExpression
-
- org.apache.camel.model.language.XPathExpression
-
- All Implemented Interfaces:
org.apache.camel.Expression,org.apache.camel.ExpressionFactory,HasExpressionType,org.apache.camel.Predicate,org.apache.camel.PredicateFactory,org.apache.camel.spi.ExpressionFactoryAware,org.apache.camel.spi.NamespaceAware,org.apache.camel.spi.PredicateFactoryAware
@Metadata(firstVersion="1.1.0", label="language,core,xml", title="XPath") public class XPathExpression extends NamespaceAwareExpressionEvaluates an XPath expression against an XML payload.
-
-
Constructor Summary
Constructors Constructor Description XPathExpression()XPathExpression(String expression)XPathExpression(org.apache.camel.Expression expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>getDocumentType()StringgetDocumentTypeName()StringgetFactoryRef()StringgetHeaderName()StringgetLanguage()StringgetLogNamespaces()StringgetObjectModel()StringgetPreCompile()Class<?>getResultType()StringgetResultTypeName()StringgetSaxon()StringgetThreadSafety()XPathFactorygetXPathFactory()voidsetDocumentType(Class<?> documentType)Class for document type to usevoidsetDocumentTypeName(String documentTypeName)Name of class for document typevoidsetFactoryRef(String factoryRef)References to a custom XPathFactory to lookup in the registryvoidsetHeaderName(String headerName)Name of header to use as input, instead of the message bodyvoidsetLogNamespaces(String logNamespaces)Whether to log namespaces which can assist during troubleshootingvoidsetObjectModel(String objectModel)The XPath object model to usevoidsetPreCompile(String preCompile)Whether to enable pre-compiling the xpath expression during initialization phase.voidsetResultType(Class<?> resultType)Sets the class of the result type (type from output).voidsetResultTypeName(String resultTypeName)Sets the class name of the result type (type from output)voidsetSaxon(String saxon)Whether to use Saxon.voidsetThreadSafety(String threadSafety)Whether to enable thread-safety for the returned result of the xpath expression.voidsetXPathFactory(XPathFactory xpathFactory)-
Methods inherited from class org.apache.camel.model.language.NamespaceAwareExpression
getNamespace, getNamespaceAsMap, getNamespaces, setNamespace, setNamespaces
-
Methods inherited from class org.apache.camel.model.language.ExpressionDefinition
createExpression, createPredicate, evaluate, getExpression, getExpressionFactory, getExpressionType, getExpressionValue, getId, getLabel, getLabel, getPredicate, getPredicateFactory, getTrim, init, initPredicate, matches, setExpression, setExpressionType, setExpressionValue, setId, setTrim, toString
-
-
-
-
Constructor Detail
-
XPathExpression
public XPathExpression()
-
XPathExpression
public XPathExpression(String expression)
-
XPathExpression
public XPathExpression(org.apache.camel.Expression expression)
-
-
Method Detail
-
getLanguage
public String getLanguage()
- Overrides:
getLanguagein classExpressionDefinition
-
getDocumentType
public Class<?> getDocumentType()
-
setDocumentType
public void setDocumentType(Class<?> documentType)
Class for document type to use The default value is org.w3c.dom.Document
-
getDocumentTypeName
public String getDocumentTypeName()
-
setDocumentTypeName
public void setDocumentTypeName(String documentTypeName)
Name of class for document type The default value is org.w3c.dom.Document
-
getResultType
public Class<?> getResultType()
-
setResultType
public void setResultType(Class<?> resultType)
Sets the class of the result type (type from output). The default result type is NodeSet
-
getResultTypeName
public String getResultTypeName()
-
setResultTypeName
public void setResultTypeName(String resultTypeName)
Sets the class name of the result type (type from output) The default result type is NodeSet
-
setSaxon
public void setSaxon(String saxon)
Whether to use Saxon.
-
getSaxon
public String getSaxon()
-
setFactoryRef
public void setFactoryRef(String factoryRef)
References to a custom XPathFactory to lookup in the registry
-
getFactoryRef
public String getFactoryRef()
-
setObjectModel
public void setObjectModel(String objectModel)
The XPath object model to use
-
getObjectModel
public String getObjectModel()
-
setLogNamespaces
public void setLogNamespaces(String logNamespaces)
Whether to log namespaces which can assist during troubleshooting
-
getLogNamespaces
public String getLogNamespaces()
-
getHeaderName
public String getHeaderName()
-
setHeaderName
public void setHeaderName(String headerName)
Name of header to use as input, instead of the message body
-
getXPathFactory
public XPathFactory getXPathFactory()
-
setXPathFactory
public void setXPathFactory(XPathFactory xpathFactory)
-
getThreadSafety
public String getThreadSafety()
-
setThreadSafety
public void setThreadSafety(String threadSafety)
Whether to enable thread-safety for the returned result of the xpath expression. This applies to when using NODESET as the result type, and the returned set has multiple elements. In this situation there can be thread-safety issues if you process the NODESET concurrently such as from a Camel Splitter EIP in parallel processing mode. This option prevents concurrency issues by doing defensive copies of the nodes. It is recommended to turn this option on if you are using camel-saxon or Saxon in your application. Saxon has thread-safety issues which can be prevented by turning this option on.
-
getPreCompile
public String getPreCompile()
-
setPreCompile
public void setPreCompile(String preCompile)
Whether to enable pre-compiling the xpath expression during initialization phase. pre-compile is enabled by default. This can be used to turn off, for example in cases the compilation phase is desired at the starting phase, such as if the application is ahead of time compiled (for example with camel-quarkus) which would then load the xpath factory of the built operating system, and not a JVM runtime.
-
-