This class also implements NamespaceContext, since it has all
the information necessary, so parser can just return element stack
instance as necesary.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | |
| protected final AttributeCollector | |
| protected final ReaderConfig | |
| protected Element | mCurrElement
Currently open element, if any; null outside root element. |
| protected int | |
| protected Element | |
| protected int | mIdAttrIndex
Index of the attribute with type of ID, if known (most likely due to Xml:id support); -1 if not available, or no ID attribute for current element. |
| protected String | |
| protected QName | |
| protected BaseNsContext | mLastNsContext
Last potentially shareable NamespaceContext created by this stack. |
| protected String | |
| protected String | |
| protected boolean | |
| protected final StringVector | mNamespaces
Vector that contains all currently active namespaces; one String for prefix, another for matching URI. |
| protected final boolean | |
| protected NsDefaultProvider | mNsDefaultProvider
Object that will need to be consulted about namespace bindings, since it has some knowledge about default namespace declarations (has default attribute value expansion). |
| protected InputProblemReporter | |
| protected long | |
| protected XMLValidator | mValidator
Optional validator object that will get called if set, and that can validate xml content. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public int | addDefaultAttribute(String localName, String uri, String prefix, String value)
Implements org. Method called by actual validator instances when attributes with default values have no explicit values for the element; if so, default value needs to be added as if it was parsed from the element. |
| public void | |
| protected XMLValidator | |
| protected void | |
| public BaseNsContext | createNonTransientNsContext(Location loc)
Method called to construct a non-transient NamespaceContext instance; generally needed when creating events to return from event-based iterators. |
| public final int | |
| public final AttributeCollector | getAttrCollector()
Method called by |
| public final int | getAttributeCount()
Implements org. This method returns number of attributes accessible from within currently active start element. |
| public String | getAttributeLocalName(int index)
Implements org.
|
| public String | getAttributeNamespace(int index)
Implements org.
|
| public String | getAttributePrefix(int index)
Implements org.
|
| public final String | Returns: Schema (DTD, RNG, W3C Schema) based type of the attribute in specified indexImplements org.
|
| public String | getAttributeValue(int index)
Implements org.
|
| public String | getAttributeValue(String nsURI, String localName)
Implements org.
|
| public String | |
| public final QName | getCurrentElementName()
Implements org. Method that can be used to access name information of the innermost (top) element in the element stack. |
| public final int | Returns: Number of active prefix/namespace mappings for current scope, NOT including mappings from enclosing elements.
|
| public final String | |
| public final int | Returns: Number of open elements in the stack; 0 when parser is in prolog/epilog, 1 inside root element and so on.
|
| public final int | getIdAttributeIndex()
Implements org. Default implementation just indicates it does not know of such attributes; this because that requires DTD information that only some implementations have. |
| public final String | |
| public final String | |
| public final String | |
| public final String | getNamespaceURI(String
prefix to look up prefix)Implements javax. Get Namespace URI bound to a prefix in the current scope. |
| public final int | getNotationAttributeIndex()
Implements org. Default implementation just indicates it does not know of such attributes; this because that requires DTD information that only some implementations have. |
| public final String | |
| public final String | getPrefix(String
URI of Namespace to lookup nsURI)Implements javax. Get prefix bound to Namespace URI in the current scope. |
| public final String | |
| public final Iterator | getPrefixes(String
URI of Namespace to lookup nsURI)Implements javax. Get all prefixes bound to a Namespace URI in the current scope. |
| public final String | |
| public final int | Returns: Number of active prefix/namespace mappings for current scope, including mappings from enclosing elements.
|
| public Location | getValidationLocation()
Implements org. Method that will return the location that best represents current location within document to be validated, if such information is available. |
| public final String | getXmlVersion()
Implements org. Method that validator can call to figure out which xml version document being validated declared (if none, "1.0" is assumed as per xml specifications 1.0 and 1.1). |
| public final boolean | |
| public final boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public final boolean | |
| public final boolean | Returns: True if stack has more elements; false if not (that is, root element closed)Method called by the stream reader to remove the topmost (start) element from the stack; called when an end element is encountered during parsing. |
| public final void | |
| protected boolean | reallyValidating()
This is a method called by the reader to ensure that we have at least one 'real' validator. |
| public void | reportProblem(XMLValidationProblem problem)
Implements org. Method called by the validator, upon encountering a validation problem. |
| public int | Returns: Text content validation state that should be effective for the fully resolved element contextMethod called to resolve element and attribute namespaces (in namespace-aware mode), and do optional validation using pluggable validator object. |
| protected void | setAutomaticDTDValidator(XMLValidator validator, NsDefaultProvider nsDefs)
Method called to connect the automatically handled DTD validator (one detected from DOCTYPE, loaded and completely handled by the stream reader without application calling validation methods). |
| public XMLValidator | |
| public XMLValidator | |
| private void | |
| public XMLValidator | |
| public int | Returns: Validation state that should be effective for the parent element stateMethod called after parsing (but before returning) end element, to allow for pluggable validators to verify correctness of the content model for the closing element. |
| public final void | |
| public final void |
| ID_ATTR_NONE | back to summary |
|---|---|
| pack-priv static final int ID_ATTR_NONE | |
| mAttrCollector | back to summary |
|---|---|
| protected final AttributeCollector mAttrCollector | |
| mConfig | back to summary |
|---|---|
| protected final ReaderConfig mConfig | |
| mCurrElement | back to summary |
|---|---|
| protected Element mCurrElement Currently open element, if any; null outside root element. | |
| mDepth | back to summary |
|---|---|
| protected int mDepth | |
| mFreeElement | back to summary |
|---|---|
| protected Element mFreeElement | |
| mIdAttrIndex | back to summary |
|---|---|
| protected int mIdAttrIndex Index of the attribute with type of ID, if known (most likely due to Xml:id support); -1 if not available, or no ID attribute for current element. | |
| mLastLocalName | back to summary |
|---|---|
| protected String mLastLocalName | |
| mLastName | back to summary |
|---|---|
| protected QName mLastName | |
| mLastNsContext | back to summary |
|---|---|
| protected BaseNsContext mLastNsContext Last potentially shareable NamespaceContext created by this stack. This reference is cleared each time bindings change (either due to a start element with new bindings, or due to the matching end element that closes scope of such binding(s)). | |
| mLastNsURI | back to summary |
|---|---|
| protected String mLastNsURI | |
| mLastPrefix | back to summary |
|---|---|
| protected String mLastPrefix | |
| mMayHaveNsDefaults | back to summary |
|---|---|
| protected boolean mMayHaveNsDefaults | |
| mNamespaces | back to summary |
|---|---|
| protected final StringVector mNamespaces Vector that contains all currently active namespaces; one String for prefix, another for matching URI. Does also include default name spaces (at most one per level). | |
| mNsAware | back to summary |
|---|---|
| protected final boolean mNsAware | |
| mNsDefaultProvider | back to summary |
|---|---|
| protected NsDefaultProvider mNsDefaultProvider Object that will need to be consulted about namespace bindings, since it has some knowledge about default namespace declarations (has default attribute value expansion). | |
| mReporter | back to summary |
|---|---|
| protected InputProblemReporter mReporter | |
| mTotalElements | back to summary |
|---|---|
| protected long mTotalElements | |
| mValidator | back to summary |
|---|---|
| protected XMLValidator mValidator Optional validator object that will get called if set, and that can validate xml content. Note that it is possible that this is set to a proxy object that calls multiple validators in sequence. | |
| InputElementStack | back to summary |
|---|---|
| protected InputElementStack(ReaderConfig cfg, boolean nsAware) | |
| addDefaultAttribute | back to summary |
|---|---|
| public int addDefaultAttribute(String localName, String uri, String prefix, String value) throws XMLStreamException Implements org. Method called by actual validator instances when attributes with default values have no explicit values for the element; if so, default value needs to be added as if it was parsed from the element.
| |
| addNsBinding | back to summary |
|---|---|
| public void addNsBinding(String prefix, String uri) Callback method called by the namespace default provider. At this point we can trust it to only call this method with somewhat valid arguments (no dups etc). | |
| addValidator | back to summary |
|---|---|
| protected XMLValidator addValidator(XMLValidator vld) | |
| connectReporter | back to summary |
|---|---|
| protected void connectReporter(InputProblemReporter rep) | |
| createNonTransientNsContext | back to summary |
|---|---|
| public BaseNsContext createNonTransientNsContext(Location loc) Method called to construct a non-transient NamespaceContext instance; generally needed when creating events to return from event-based iterators. | |
| findAttributeIndex | back to summary |
|---|---|
| public final int findAttributeIndex(String nsURI, String localName) Implements org.
| |
| getAttrCollector | back to summary |
|---|---|
| public final AttributeCollector getAttrCollector() Method called by | |
| getAttributeCount | back to summary |
|---|---|
| public final int getAttributeCount() Implements org. Doc from org. This method returns number of attributes accessible from within currently active start element. Note this method is only guaranteed to be callable during execution
of Also note that whether defaulted attributes (attributes for which values are only available via attribute defaulting) are accessible depends on exact time when this method is called, and in general can not be assumed to function reliably.
| |
| getAttributeLocalName | back to summary |
|---|---|
| public String getAttributeLocalName(int index) Implements org.
| |
| getAttributeNamespace | back to summary |
|---|---|
| public String getAttributeNamespace(int index) Implements org.
| |
| getAttributePrefix | back to summary |
|---|---|
| public String getAttributePrefix(int index) Implements org.
| |
| getAttributeType | back to summary |
|---|---|
| public final String getAttributeType(int index) Implements org. | |
| getAttributeValue | back to summary |
|---|---|
| public String getAttributeValue(int index) Implements org.
| |
| getAttributeValue | back to summary |
|---|---|
| public String getAttributeValue(String nsURI, String localName) Implements org.
| |
| getBaseUri | back to summary |
|---|---|
| public String getBaseUri() Implements org.
| |
| getCurrentElementName | back to summary |
|---|---|
| public final QName getCurrentElementName() Implements org. Doc from org. Method that can be used to access name information of the innermost (top) element in the element stack. | |
| getCurrentNsCount | back to summary |
|---|---|
public final int getCurrentNsCount()
| |
| getDefaultNsURI | back to summary |
|---|---|
| public final String getDefaultNsURI() | |
| getDepth | back to summary |
|---|---|
public final int getDepth()
| |
| getIdAttributeIndex | back to summary |
|---|---|
| public final int getIdAttributeIndex() Implements org. Default implementation just indicates it does not know of such attributes; this because that requires DTD information that only some implementations have.
| |
| getLocalName | back to summary |
|---|---|
| public final String getLocalName() | |
| getLocalNsPrefix | back to summary |
|---|---|
| public final String getLocalNsPrefix(int index) | |
| getLocalNsURI | back to summary |
|---|---|
| public final String getLocalNsURI(int index) | |
| getNamespaceURI | back to summary | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final String getNamespaceURI(String prefix) Implements javax. Doc from javax. Get Namespace URI bound to a prefix in the current scope. When requesting a Namespace URI by prefix, the following table describes the returned Namespace URI value for all possible prefix values:
| |||||||||||||||
| getNotationAttributeIndex | back to summary |
|---|---|
| public final int getNotationAttributeIndex() Implements org. Default implementation just indicates it does not know of such attributes; this because that requires DTD information that only some implementations have.
| |
| getNsURI | back to summary |
|---|---|
| public final String getNsURI() | |
| getPrefix | back to summary | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final String getPrefix(String nsURI) Implements javax. Doc from javax. Get prefix bound to Namespace URI in the current scope. To get all prefixes bound to a Namespace URI in the current
scope, use When requesting a prefix by Namespace URI, the following table describes the returned prefix value for all Namespace URI values:
| |||||||||||||||
| getPrefix | back to summary |
|---|---|
| public final String getPrefix() | |
| getPrefixes | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public final Iterator Implements javax. Doc from javax. Get all prefixes bound to a Namespace URI in the current scope. An Iterator over String elements is returned in an arbitrary, implementation dependent, order. The When requesting prefixes by Namespace URI, the following table describes the returned prefixes value for all Namespace URI values:
| |||||||||||||
| getTopElementDesc | back to summary |
|---|---|
| public final String getTopElementDesc() | |
| getTotalNsCount | back to summary |
|---|---|
public final int getTotalNsCount()
| |
| getValidationLocation | back to summary |
|---|---|
| public Location getValidationLocation() Implements org. Doc from org. Method that will return the location that best represents current location within document to be validated, if such information is available. Note it is likely that even when a location is known, it may not be very accurate; for example, when attributes are validated, it is possible that they all would point to a single location that may point to the start of the element that contains attributes.
| |
| getXmlVersion | back to summary |
|---|---|
| public final String getXmlVersion() Implements org. Doc from org. Method that validator can call to figure out which xml version document being validated declared (if none, "1.0" is assumed as per xml specifications 1.0 and 1.1). | |
| isEmpty | back to summary |
|---|---|
| public final boolean isEmpty() | |
| isNamespaceAware | back to summary |
|---|---|
| public final boolean isNamespaceAware() | |
| isNotationDeclared | back to summary |
|---|---|
| public boolean isNotationDeclared(String name) Implements org.
| |
| isPrefixLocallyDeclared | back to summary |
|---|---|
| public boolean isPrefixLocallyDeclared(String internedPrefix) | |
| isUnparsedEntityDeclared | back to summary |
|---|---|
| public boolean isUnparsedEntityDeclared(String name) Implements org.
| |
| matches | back to summary |
|---|---|
| public final boolean matches(String prefix, String localName) | |
| pop | back to summary |
|---|---|
| public final boolean pop() throws XMLStreamException Method called by the stream reader to remove the topmost (start) element from the stack; called when an end element is encountered during parsing.
| |
| push | back to summary |
|---|---|
| public final void push(String prefix, String localName) throws XMLStreamException Method called by the stream reader to add new (start) element into the stack in namespace-aware mode; called when a start element is encountered during parsing, but only in ns-aware mode. | |
| reallyValidating | back to summary |
|---|---|
| protected boolean reallyValidating() This is a method called by the reader to ensure that we have at
least one 'real' validator. This is only needed to ensure that
validation problems that the reader can detect (illegal textual
content) can be reported as validity errors. Since the validator
API does not have a good way to cleanly deal with such a possibility,
the check is rather fragile, but should work for now: essentially
we need at least one validator object that either is not a sub-class
of !!! TODO: remove need for this method (and method itself) with Woodstox 4.0, by adding necessary support in Stax2 XMLValidator interface. | |
| reportProblem | back to summary |
|---|---|
| public void reportProblem(XMLValidationProblem problem) throws XMLStreamException Implements org. Doc from org. Method called by the validator, upon encountering a validation
problem. Implementations are encouraged to allow an optional
Note Stax2 version 2 only allowed throwing instances
of
| |
| resolveAndValidateElement | back to summary |
|---|---|
| public int resolveAndValidateElement() throws XMLStreamException Method called to resolve element and attribute namespaces (in namespace-aware mode), and do optional validation using pluggable validator object.
| |
| setAutomaticDTDValidator | back to summary |
|---|---|
| protected void setAutomaticDTDValidator(XMLValidator validator, NsDefaultProvider nsDefs) Method called to connect the automatically handled DTD validator (one detected from DOCTYPE, loaded and completely handled by the stream reader without application calling validation methods). Handled separately, since its behaviour is potentially different from that of explicitly added validators. | |
| stopValidatingAgainst | back to summary |
|---|---|
| public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException | |
| stopValidatingAgainst | back to summary |
|---|---|
| public XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException | |
| throwIllegalIndex | back to summary |
|---|---|
| private void throwIllegalIndex(int index, int localCount) | |
| validateAgainst | back to summary |
|---|---|
| public XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException | |
| validateEndElement | back to summary |
|---|---|
| public int validateEndElement() throws XMLStreamException Method called after parsing (but before returning) end element, to allow for pluggable validators to verify correctness of the content model for the closing element.
| |
| validateText | back to summary |
|---|---|
| public final void validateText(TextBuffer tb, boolean lastTextSegment) throws XMLStreamException | |
| validateText | back to summary |
|---|---|
| public final void validateText(String contents, boolean lastTextSegment) throws XMLStreamException | |