Annotation Interface XPath


@Retention(RUNTIME) @Documented @Target({FIELD,METHOD,PARAMETER}) @LanguageAnnotation(language="xpath", factory=XPathAnnotationExpressionFactory.class) public @interface XPath
Used to inject an XPath expression into a field, property, method or parameter when using Bean Integration.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The XPath which will be applied
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The name of the header we want to apply the XPath expression to.
    boolean
    Whether to log namespaces which can assist during troubleshooting
    org.apache.camel.support.language.NamespacePrefix[]
    Namespace prefix mappings
    boolean
    Whether to enable pre-compiling the xpath expression during initialization phase.
    The name of the header we want to apply the XPath expression to.
    The desired return type from the evaluated XPath expression.
  • Element Details

    • value

      String value
      The XPath which will be applied
    • namespaces

      org.apache.camel.support.language.NamespacePrefix[] namespaces
      Namespace prefix mappings
      Default:
      {@org.apache.camel.support.language.NamespacePrefix(prefix="soap", uri="http://www.w3.org/2003/05/soap-envelope"), @org.apache.camel.support.language.NamespacePrefix(prefix="xsd", uri="http://www.w3.org/2001/XMLSchema")}
    • resultType

      Class<?> resultType
      The desired return type from the evaluated XPath expression.
      Default:
      java.lang.Object.class
    • headerName

      String headerName
      The name of the header we want to apply the XPath expression to. If this is empty then the XPath expression will be applied to the exchange property or the body instead.
      Default:
      ""
    • propertyName

      String propertyName
      The name of the header we want to apply the XPath expression to. If this is empty then the XPath expression will be applied to the body instead.

      It has a lower precedent than the name of header if both are set.

      Default:
      ""
    • logNamespaces

      boolean logNamespaces
      Whether to log namespaces which can assist during troubleshooting
      Default:
      false
    • 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.
      Default:
      true