Class NamespaceBase

  • All Implemented Interfaces:
    javax.xml.stream.events.Attribute, javax.xml.stream.events.Namespace, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants

    public class NamespaceBase
    extends AttributeBase
    implements javax.xml.stream.events.Namespace
    • Field Detail

      • XMLNS_ATTRIBUTE_NS_URI

        static final java.lang.String XMLNS_ATTRIBUTE_NS_URI
        See Also:
        Constant Field Values
      • W3C_XML_SCHEMA_NS_URI

        static final java.lang.String W3C_XML_SCHEMA_NS_URI
        See Also:
        Constant Field Values
      • W3C_XML_SCHEMA_INSTANCE_NS_URI

        static final java.lang.String W3C_XML_SCHEMA_INSTANCE_NS_URI
        See Also:
        Constant Field Values
      • defaultDeclaration

        private boolean defaultDeclaration
    • Constructor Detail

      • NamespaceBase

        public NamespaceBase​(java.lang.String namespaceURI)
        a namespace attribute has a form: xmlns:NCName="URI reference"
      • NamespaceBase

        public NamespaceBase​(java.lang.String prefix,
                             java.lang.String namespaceURI)
        Create a new Namespace
        Parameters:
        prefix - prefix of a namespace is the local name for an attribute
        namespaceURI - the uri reference of a namespace is the value for an attribute
    • Method Detail

      • setPrefix

        void setPrefix​(java.lang.String prefix)
      • getPrefix

        public java.lang.String getPrefix()
        Specified by:
        getPrefix in interface javax.xml.stream.events.Namespace
      • setNamespaceURI

        void setNamespaceURI​(java.lang.String uri)
        set Namespace URI reference (xmlns:prefix = "uri")
        Parameters:
        uri - the uri reference of a namespace is the value for an attribute
      • getNamespaceURI

        public java.lang.String getNamespaceURI()
        Specified by:
        getNamespaceURI in interface javax.xml.stream.events.Namespace
      • isNamespace

        public boolean isNamespace()
        Description copied from class: EventBase
        A utility function to check if this event is a Namespace.
        Specified by:
        isNamespace in interface javax.xml.stream.events.XMLEvent
        Overrides:
        isNamespace in class EventBase
        See Also:
        Namespace
      • isDefaultNamespaceDeclaration

        public boolean isDefaultNamespaceDeclaration()
        Specified by:
        isDefaultNamespaceDeclaration in interface javax.xml.stream.events.Namespace