Class NamespaceContextBuilder


  • public class NamespaceContextBuilder
    extends Object
    Provides a builder for namespace contexts making it easy to provide namespace contexts to for example xpath evaluations.
    • Constructor Detail

      • NamespaceContextBuilder

        public NamespaceContextBuilder()
        Creates a new instance.
      • NamespaceContextBuilder

        public NamespaceContextBuilder​(String defaultNsUri)
        Creates a new instance with the specified default namespace uri.
        Parameters:
        defaultNsUri - the default namespace uri
    • Method Detail

      • add

        public NamespaceContextBuilder add​(String prefix,
                                           String uri)
        Adds a new namespace binding with the specified prefix and uri.
        Parameters:
        prefix - the namespace prefix
        uri - the namespace uri
        Returns:
        returns this builder
      • build

        public NamespaceContext build()
        Creates a new namespace context with the currently configured settings.
        Returns:
        returns a new namepsace context