Class 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 Detail

      • PathToNodeBuilder

        public PathToNodeBuilder()
    • Method Detail

      • 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
      • 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.
      • 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
      • build

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