Package com.fasterxml.aalto.in
Class FixedNsContext
java.lang.Object
com.fasterxml.aalto.in.FixedNsContext
- All Implemented Interfaces:
NamespaceContext
Non-transient implementation of
NamespaceContext
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String[]
Array that contains prefix/namespace-uri pairs, ordered from the most recent declaration to older ones.protected final NsDeclaration
We will keep a reference to the last namespace declaration in effect at point when this instance was created.Temporary List used for constructing compact namespace binding information that we will actually use.static final FixedNsContext
We can share and reuse "no bindings" instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getNamespaceURI
(String prefix) final String
getPrefixes
(String nsURI) reuseOrCreate
(NsDeclaration currLastDecl) Method called to either reuse this context or construct a new one.toString()
-
Field Details
-
EMPTY_CONTEXT
We can share and reuse "no bindings" instance. -
_lastDeclaration
We will keep a reference to the last namespace declaration in effect at point when this instance was created. This is used for lazy invalidation of instances: if last declaration for an instance differs from the last seen by the reader, a new context must be created. -
_declarationData
Array that contains prefix/namespace-uri pairs, ordered from the most recent declaration to older ones. Array is always exactly sized so there are no empty entries at the end. -
_tmpDecl
Temporary List used for constructing compact namespace binding information that we will actually use.
-
-
Constructor Details
-
FixedNsContext
-
-
Method Details
-
reuseOrCreate
Method called to either reuse this context or construct a new one. Reuse is ok if the currently active last declaration has not changed since time this instance was created. -
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefix
in interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixes
in interfaceNamespaceContext
-
toString
-