Class XPathExpression.Builder

All Implemented Interfaces:
LanguageBuilder<XPathExpression>
Enclosing class:
XPathExpression

Builder is a specific builder for XPathExpression.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • documentType

      public XPathExpression.Builder documentType(Class<?> documentType)
      Class for document type to use

      The default value is org.w3c.dom.Document

    • xpathFactory

      public XPathExpression.Builder xpathFactory(XPathFactory xpathFactory)
    • documentTypeName

      public XPathExpression.Builder documentTypeName(String documentTypeName)
      Name of class for document type

      The default value is org.w3c.dom.Document

    • resultQName

      public XPathExpression.Builder resultQName(String resultQName)
      Sets the class name of the result type (type from output)

      The default result type is NodeSet

    • resultQName

      public XPathExpression.Builder resultQName(XPathExpression.ResultQName resultQName)
      Sets the class name of the result type (type from output)

      The default result type is NodeSet

    • saxon

      public XPathExpression.Builder saxon(String saxon)
      Whether to use Saxon.
    • saxon

      public XPathExpression.Builder saxon(boolean saxon)
      Whether to use Saxon.
    • factoryRef

      public XPathExpression.Builder factoryRef(String factoryRef)
      References to a custom XPathFactory to lookup in the registry
    • objectModel

      public XPathExpression.Builder objectModel(String objectModel)
      The XPath object model to use
    • logNamespaces

      public XPathExpression.Builder logNamespaces(String logNamespaces)
      Whether to log namespaces which can assist during troubleshooting
    • logNamespaces

      public XPathExpression.Builder logNamespaces(boolean logNamespaces)
      Whether to log namespaces which can assist during troubleshooting
    • threadSafety

      public XPathExpression.Builder threadSafety(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.

    • threadSafety

      public XPathExpression.Builder threadSafety(boolean 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.

    • preCompile

      public XPathExpression.Builder preCompile(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.

    • preCompile

      public XPathExpression.Builder preCompile(boolean 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.

    • end

      public XPathExpression end()
      Description copied from interface: LanguageBuilder
      Ends the build of an expression.
      Returns:
      the expression fully built.
    • namespaces

      public XPathExpression.Builder namespaces(org.apache.camel.support.builder.Namespaces namespaces)
      Injects the XML Namespaces of prefix -> uri mappings
      Parameters:
      namespaces - the XML namespaces
    • namespaces

      public XPathExpression.Builder namespaces(Map<String,String> namespaces)
      Injects the XML Namespaces of prefix -> uri mappings
      Parameters:
      namespaces - the XML namespaces with the key of prefixes and the value the URIs
    • namespace

      public XPathExpression.Builder namespace(List<PropertyDefinition> namespace)
      Injects the XML Namespaces of prefix -> uri mappings
    • id

      Sets the id of this node
    • trim

      public XPathExpression.Builder trim(String trim)
      Whether to trim the value to remove leading and trailing whitespaces and line breaks
    • trim

      public XPathExpression.Builder trim(boolean trim)
      Whether to trim the value to remove leading and trailing whitespaces and line breaks
    • expression

      public XPathExpression.Builder expression(String expression)
      The expression value in your chosen language syntax
    • predicate

      public XPathExpression.Builder predicate(org.apache.camel.Predicate predicate)