Class NsDeclaration

java.lang.Object
com.fasterxml.aalto.in.NsDeclaration

public final class NsDeclaration extends 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 Details

    • 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 String mPreviousURI
    • mPrevDeclaration

      private final NsDeclaration mPrevDeclaration
    • 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 Details

  • Method Details

    • getLevel

      public int getLevel()
    • getPrev

      public NsDeclaration getPrev()
    • getBinding

      public NsBinding getBinding()
    • getPrefix

      public String getPrefix()
    • getCurrNsURI

      public String getCurrNsURI()
    • hasPrefix

      public boolean hasPrefix(String prefix)
    • hasNsURI

      public boolean hasNsURI(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(String prefix, int level)
    • countDeclsOnLevel

      public int countDeclsOnLevel(int level)
    • toString

      public String toString()
      Overrides:
      toString in class Object