Package com.fasterxml.aalto.in
Class NsDeclaration
- java.lang.Object
-
- com.fasterxml.aalto.in.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 Summary
Fields Modifier and Type Field Description private 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)private int
mLevel
Nesting level of this declaration.private NsDeclaration
mPrevDeclaration
private java.lang.String
mPreviousURI
-
Constructor Summary
Constructors Constructor Description NsDeclaration(NsBinding binding, java.lang.String newURI, NsDeclaration prevDecl, int level)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
alreadyDeclared(java.lang.String prefix, int level)
int
countDeclsOnLevel(int level)
NsBinding
getBinding()
java.lang.String
getCurrNsURI()
int
getLevel()
java.lang.String
getPrefix()
NsDeclaration
getPrev()
boolean
hasNsURI(java.lang.String uri)
boolean
hasPrefix(java.lang.String prefix)
java.lang.String
toString()
NsDeclaration
unbind()
Method called after END_ELEMENT is processed, to unbind declaration that now goes out of scope
-
-
-
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
-
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 Detail
-
NsDeclaration
public NsDeclaration(NsBinding binding, java.lang.String newURI, NsDeclaration prevDecl, int level)
-
-
Method Detail
-
getLevel
public int getLevel()
-
getPrev
public NsDeclaration getPrev()
-
getBinding
public NsBinding getBinding()
-
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 classjava.lang.Object
-
-