Class XMLHelper.PathToNodeBuilder

java.lang.Object
com.helger.xml.XMLHelper.PathToNodeBuilder
All Implemented Interfaces:
com.helger.commons.builder.IBuilder<String>
Enclosing class:
XMLHelper

@NotThreadSafe public static class XMLHelper.PathToNodeBuilder extends Object implements com.helger.commons.builder.IBuilder<String>
Builder class for the different possibilities to get the path of a node
Since:
10.2.2
Author:
Philip Helger
  • Constructor Details

    • PathToNodeBuilder

      public PathToNodeBuilder()
  • Method Details

    • node

      The node to get the path from.
      Parameters:
      a - Node to be used. Should not be null.
      Returns:
      this for chaining
    • separator

      @Nonnull public XMLHelper.PathToNodeBuilder separator(char c)
      Set the separator to be used.
      Parameters:
      c - The separator char
      Returns:
      this for chaining
    • separator

      Set the separator to be used.
      Parameters:
      s - The separator string. Should not be null.
      Returns:
      this for chaining
    • excludeDocumentNode

      @Nonnull public XMLHelper.PathToNodeBuilder excludeDocumentNode(boolean b)
      Determine to include or exclude the document node in the resulting path.
      Parameters:
      b - true to exclude it, false to include it
      Returns:
      this for chaining
    • excludeDocumentNode

      @Nonnull public XMLHelper.PathToNodeBuilder excludeDocumentNode()
      Shortcut to exclude the document Node from the resulting output
      Returns:
      this for chaining
      See Also:
    • includeDocumentNode

      @Nonnull public XMLHelper.PathToNodeBuilder includeDocumentNode()
      Shortcut to include the document Node in the resulting output
      Returns:
      this for chaining
      See Also:
    • zeroBasedIndex

      @Nonnull public XMLHelper.PathToNodeBuilder zeroBasedIndex(boolean b)
      Determine whether a 0-based index or a 1-based index should be used. For XPath usage etc. a 1-based index should be used. For a 0-based index the first element uses [0] and for a 1-based index this is [1].
      Parameters:
      b - true to use a 0-based index, false
      Returns:
      this for chaining.
    • zeroBasedIndex

      @Nonnull public XMLHelper.PathToNodeBuilder zeroBasedIndex()
      Shortcut to enable the usage of a zero based index.
      Returns:
      this for chaining
      See Also:
    • oneBasedIndex

      @Nonnull public XMLHelper.PathToNodeBuilder oneBasedIndex()
      Shortcut to enable the usage of a one based index.
      Returns:
      this for chaining
      See Also:
    • forceUseIndex

      @Nonnull public XMLHelper.PathToNodeBuilder forceUseIndex(boolean b)
      Enable or disable the force of an index. If the index is forced, the [0] or [1], depending on zeroBasedIndex(boolean) is always emitted, even if only one element exists. If this is disabled and only element exists, the index is not emitted.
      Parameters:
      b - true to force the index, false to omit it if possible.
      Returns:
      this for chaining
    • trailingSeparator

      @Nonnull public XMLHelper.PathToNodeBuilder trailingSeparator(boolean b)
      Enable or disable the usage of a trailing separator. If enabled, the output is e.g. element/ compared to the output element if the trailing separator is disabled.
      Parameters:
      b - true to use a trailing separator, false to omit it.
      Returns:
      this for chaining
    • compareIncludingNamespaceURI

      @Nonnull public XMLHelper.PathToNodeBuilder compareIncludingNamespaceURI(boolean b)
      Compare with namespace URI and local name, or just with the tag name.
      Parameters:
      b - true to compare with namespace URI, false to compare without namespace URI
      Returns:
      this for chaining
    • namespaceContext

      Set the optional namespace context to be used for emitting prefixes. This is optional.
      Parameters:
      a - The namespace context to be used. May be null.
      Returns:
      this for chaining
    • build

      @Nonnull public String build()
      Specified by:
      build in interface com.helger.commons.builder.IBuilder<String>