Class NamespaceBinding

    • Constructor Detail

      • NamespaceBinding

        public NamespaceBinding​(String prefix,
                                NamespaceUri uri)
        Create a binding of a prefix to a URI
        Parameters:
        prefix - the prefix: either an NCName, or a zero-length string to bind the default namespace. Must not be null.
        uri - the namespace URI: either a URI, or a zero-length string to unbind the prefix. Must not be null.
    • Method Detail

      • getPrefix

        public String getPrefix()
        Get the prefix part of the binding
        Returns:
        the prefix. Never null. The zero-length string indicates a binding for the default namespace.
      • getNamespaceUri

        public NamespaceUri getNamespaceUri()
        Get the URI part of the binding
        Returns:
        the URI. Never null. The zero-length string indicates an unbinding of the prefix. For the default namespace (prefix="") this indicates that the prefix refers to names in no namespace; for other prefixes, it indicates that the prefix is not bound to any namespace and therefore cannot be used.
      • isXmlNamespace

        public boolean isXmlNamespace()
        Ask whether this is a binding for the XML namespace
        Returns:
        true if this is the binding of the prefix "xml" to the standard XML namespace.
      • isDefaultUndeclaration

        public boolean isDefaultUndeclaration()
        Ask whether this is an undeclaration of the default prefix, that is, a namespace binding corresponding to xmlns=""
        Returns:
        true if this corresponding to xmlns=""
      • equals

        public boolean equals​(Object obj)
        Test if this namespace binding is the same as another
        Overrides:
        equals in class Object
        Parameters:
        obj - the comparand
        Returns:
        true if the comparand is a Namespace binding of the same prefix to the same URI
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object