Package org.apache.camel.model.language
Class 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 NamespaceAwareExpression
Evaluates an XPath expression against an XML payload.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilderis a specific builder forXPathExpression.static enumResultQNamedefines the possible class name of the result types that can be used.Nested classes/interfaces inherited from class org.apache.camel.model.language.NamespaceAwareExpression
NamespaceAwareExpression.AbstractNamespaceAwareBuilder<T extends NamespaceAwareExpression.AbstractNamespaceAwareBuilder<T,E>, E extends NamespaceAwareExpression> Nested classes/interfaces inherited from class org.apache.camel.model.language.SingleInputTypedExpressionDefinition
SingleInputTypedExpressionDefinition.AbstractBuilder<T extends SingleInputTypedExpressionDefinition.AbstractBuilder<T,E>, E extends SingleInputTypedExpressionDefinition> -
Constructor Summary
ConstructorsModifierConstructorDescriptionXPathExpression(String expression) XPathExpression(org.apache.camel.Expression expression) protectedXPathExpression(XPathExpression source) -
Method Summary
Modifier and TypeMethodDescriptionClass<?> getSaxon()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 registryvoidsetLogNamespaces(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. pre-compile is enabled by default.voidsetResultQName(String resultQName) Sets the output type supported by XPath.voidWhether 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, setNamespacesMethods inherited from class org.apache.camel.model.language.SingleInputTypedExpressionDefinition
getSource, setSourceMethods inherited from class org.apache.camel.model.language.TypedExpressionDefinition
getResultType, getResultTypeName, setResultType, setResultTypeNameMethods 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 Details
-
XPathExpression
public XPathExpression() -
XPathExpression
-
XPathExpression
-
XPathExpression
public XPathExpression(org.apache.camel.Expression expression)
-
-
Method Details
-
copyDefinition
- Overrides:
copyDefinitionin classExpressionDefinition
-
getLanguage
- Overrides:
getLanguagein classExpressionDefinition
-
getDocumentType
-
setDocumentType
Class for document type to use The default value is org.w3c.dom.Document -
getDocumentTypeName
-
setDocumentTypeName
Name of class for document type The default value is org.w3c.dom.Document -
getResultQName
-
setResultQName
Sets the output type supported by XPath. -
setSaxon
Whether to use Saxon. -
getSaxon
-
setFactoryRef
References to a custom XPathFactory to lookup in the registry -
getFactoryRef
-
setObjectModel
The XPath object model to use -
getObjectModel
-
setLogNamespaces
Whether to log namespaces which can assist during troubleshooting -
getLogNamespaces
-
getXPathFactory
-
setXPathFactory
-
getThreadSafety
-
setThreadSafety
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
-
setPreCompile
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.
-