Class NsDeclaration


  • public final class NsDeclaration
    extends java.lang.Object
    This class encapsulates information about a namespace binding declaration, associated with start elements. Declarations are stored as a linked list, to minimize fixed allocations, and since they only need to be accessed directly when dealing with START_ELEMENT and END_ELEMENT, not when binding element or attribute names.
    • Field Detail

      • mBinding

        private final NsBinding mBinding
        Reference to the actual binding that will be updated by this declaration (URI changed when declaration comes in and goes out of scope)
      • mPreviousURI

        private final java.lang.String mPreviousURI
      • mLevel

        private final int mLevel
        Nesting level of this declaration. Used when unbinding declarations, to see if the particular declaration is associated with the start element for which end element is pair.
    • Constructor Detail

      • NsDeclaration

        public NsDeclaration​(NsBinding binding,
                             java.lang.String newURI,
                             NsDeclaration prevDecl,
                             int level)
    • Method Detail

      • getLevel

        public int getLevel()
      • getPrefix

        public java.lang.String getPrefix()
      • getCurrNsURI

        public java.lang.String getCurrNsURI()
      • hasPrefix

        public boolean hasPrefix​(java.lang.String prefix)
      • hasNsURI

        public boolean hasNsURI​(java.lang.String uri)
      • unbind

        public NsDeclaration unbind()
        Method called after END_ELEMENT is processed, to unbind declaration that now goes out of scope
      • alreadyDeclared

        public boolean alreadyDeclared​(java.lang.String prefix,
                                       int level)
      • countDeclsOnLevel

        public int countDeclsOnLevel​(int level)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object