com.ctc.wstx.sr
Class NonNsInputElementStack

java.lang.Object
  extended bycom.ctc.wstx.sr.InputElementStack
      extended bycom.ctc.wstx.sr.NonNsInputElementStack
All Implemented Interfaces:
AttributeInfo, InputConfigFlags, javax.xml.namespace.NamespaceContext
Direct Known Subclasses:
VNonNsInputElementStack

public class NonNsInputElementStack
extends InputElementStack

Sub-class of InputElementStack used when operating in non-namespace-aware, non validating mode.


Field Summary
protected  com.ctc.wstx.sr.NonNsAttributeCollector mAttrCollector
           
protected  java.lang.String[] mElements
          Array that contains path of open elements from root, one String for each open start element.
protected  java.lang.String mLastLocalName
           
protected  javax.xml.namespace.QName mLastName
           
protected  int mSize
          Number of Strings in mElements that are valid.
 
Fields inherited from class com.ctc.wstx.sr.InputElementStack
mReporter, UNKNOWN_ATTR_TYPE
 
Fields inherited from interface com.ctc.wstx.cfg.InputConfigFlags
CFG_CACHE_DTDS, CFG_COALESCE_TEXT, CFG_INTERN_NS_URIS, CFG_LAZY_PARSING, CFG_NAMESPACE_AWARE, CFG_NORMALIZE_ATTR_VALUES, CFG_NORMALIZE_LFS, CFG_PRESERVE_LOCATION, CFG_REPLACE_ENTITY_REFS, CFG_REPORT_ALL_TEXT_AS_CHARACTERS, CFG_REPORT_PROLOG_WS, CFG_SUPPORT_DTD, CFG_SUPPORT_DTDPP, CFG_SUPPORT_EXTERNAL_ENTITIES, CFG_VALIDATE_AGAINST_DTD, CFG_VALIDATE_TEXT_CHARS, CONTENT_ALLOW_DTD_ANY, CONTENT_ALLOW_MIXED, CONTENT_ALLOW_NON_MIXED, CONTENT_ALLOW_NONE, CONTENT_ALLOW_UNDEFINED
 
Constructor Summary
NonNsInputElementStack(int initialSize, boolean normAttrs)
           
 
Method Summary
 BaseNsContext createNonTransientNsContext(javax.xml.stream.Location loc)
          Method called to construct a non-transient NamespaceContext instance; generally needed when creating events to return from event-based iterators.
 int findAttributeIndex(java.lang.String nsURI, java.lang.String localName)
           
 AttributeCollector getAttrCollector()
           
 int getAttributeCount()
           
 int getCurrentNsCount()
           
 java.lang.String getDefaultNsURI()
           
 int getDepth()
           
 java.lang.String getLocalName()
           
 java.lang.String getLocalNsPrefix(int index)
           
 java.lang.String getLocalNsURI(int index)
           
 java.lang.String getNamespaceURI(java.lang.String prefix)
           
 java.lang.String getNsURI()
           
 java.lang.String getPrefix()
           
 java.lang.String getPrefix(java.lang.String nsURI)
           
 java.util.Iterator getPrefixes(java.lang.String nsURI)
           
 javax.xml.namespace.QName getQName()
           
 java.lang.String getTopElementDesc()
           
 int getTotalNsCount()
           
 boolean isEmpty()
           
 boolean isNamespaceAware()
           
 boolean matches(java.lang.String prefix, java.lang.String localName)
           
 int pop()
          Method called by the stream reader to remove the topmost (start) element from the stack; called when an end element is encountered during parsing.
 void push(java.lang.String fullName)
          Method called by the stream reader to add new (start) element into the stack in non-namespace mode; called when a start element is encountered during parsing, but only in non-namespace mode.
 void push(java.lang.String prefix, java.lang.String localName)
          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.
 int resolveElem(boolean internNsURIs)
          Method called to update information about top of the stack, with attribute information passed in.
 
Methods inherited from class com.ctc.wstx.sr.InputElementStack
connectReporter, getAttributeType, getIdAttributeIndex, getNotationAttributeIndex, setElementSpecs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mAttrCollector

protected final com.ctc.wstx.sr.NonNsAttributeCollector mAttrCollector

mElements

protected java.lang.String[] mElements
Array that contains path of open elements from root, one String for each open start element.


mSize

protected int mSize
Number of Strings in mElements that are valid.


mLastLocalName

protected java.lang.String mLastLocalName

mLastName

protected javax.xml.namespace.QName mLastName
Constructor Detail

NonNsInputElementStack

public NonNsInputElementStack(int initialSize,
                              boolean normAttrs)
Method Detail

push

public final void push(java.lang.String prefix,
                       java.lang.String localName)
Description copied from class: InputElementStack
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.

Specified by:
push in class InputElementStack

push

public final void push(java.lang.String fullName)
Description copied from class: InputElementStack
Method called by the stream reader to add new (start) element into the stack in non-namespace mode; called when a start element is encountered during parsing, but only in non-namespace mode.

Specified by:
push in class InputElementStack

pop

public int pop()
        throws WstxException
Description copied from class: InputElementStack
Method called by the stream reader to remove the topmost (start) element from the stack; called when an end element is encountered during parsing.

Specified by:
pop in class InputElementStack
Returns:
Validation state that should be effective for the parent element state
Throws:
WstxException

resolveElem

public int resolveElem(boolean internNsURIs)
                throws WstxException
Method called to update information about top of the stack, with attribute information passed in. Will resolve namespace references, and update namespace stack with information.

Specified by:
resolveElem in class InputElementStack
Returns:
Validation state that should be effective for the fully resolved element context
Throws:
WstxException

isNamespaceAware

public final boolean isNamespaceAware()
Specified by:
isNamespaceAware in class InputElementStack

getDepth

public final int getDepth()
Specified by:
getDepth in class InputElementStack
Returns:
Number of open elements in the stack; 0 when parser is in prolog/epilog, 1 inside root element and so on.

getAttrCollector

public final AttributeCollector getAttrCollector()
Specified by:
getAttrCollector in class InputElementStack

createNonTransientNsContext

public final BaseNsContext createNonTransientNsContext(javax.xml.stream.Location loc)
Method called to construct a non-transient NamespaceContext instance; generally needed when creating events to return from event-based iterators.

Specified by:
createNonTransientNsContext in class InputElementStack

getNamespaceURI

public final java.lang.String getNamespaceURI(java.lang.String prefix)
Specified by:
getNamespaceURI in interface javax.xml.namespace.NamespaceContext
Specified by:
getNamespaceURI in class InputElementStack

getPrefix

public final java.lang.String getPrefix(java.lang.String nsURI)
Specified by:
getPrefix in interface javax.xml.namespace.NamespaceContext
Specified by:
getPrefix in class InputElementStack

getPrefixes

public final java.util.Iterator getPrefixes(java.lang.String nsURI)
Specified by:
getPrefixes in interface javax.xml.namespace.NamespaceContext
Specified by:
getPrefixes in class InputElementStack

getAttributeCount

public final int getAttributeCount()
Specified by:
getAttributeCount in interface AttributeInfo
Specified by:
getAttributeCount in class InputElementStack

findAttributeIndex

public final int findAttributeIndex(java.lang.String nsURI,
                                    java.lang.String localName)
Specified by:
findAttributeIndex in interface AttributeInfo
Specified by:
findAttributeIndex in class InputElementStack
Returns:
Index of the specified attribute, if the current element has such an attribute (explicit, or one created via default value expansion); -1 if not.

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in class InputElementStack

getDefaultNsURI

public final java.lang.String getDefaultNsURI()
Specified by:
getDefaultNsURI in class InputElementStack

getNsURI

public final java.lang.String getNsURI()
Specified by:
getNsURI in class InputElementStack

getPrefix

public final java.lang.String getPrefix()
Specified by:
getPrefix in class InputElementStack

getLocalName

public final java.lang.String getLocalName()
Specified by:
getLocalName in class InputElementStack

getQName

public final javax.xml.namespace.QName getQName()
Specified by:
getQName in class InputElementStack

matches

public final boolean matches(java.lang.String prefix,
                             java.lang.String localName)
Specified by:
matches in class InputElementStack

getTopElementDesc

public final java.lang.String getTopElementDesc()
Specified by:
getTopElementDesc in class InputElementStack

getTotalNsCount

public final int getTotalNsCount()
Specified by:
getTotalNsCount in class InputElementStack

getCurrentNsCount

public final int getCurrentNsCount()
Specified by:
getCurrentNsCount in class InputElementStack
Returns:
Number of active prefix/namespace mappings for current scope, NOT including mappings from enclosing elements.

getLocalNsPrefix

public final java.lang.String getLocalNsPrefix(int index)
Specified by:
getLocalNsPrefix in class InputElementStack

getLocalNsURI

public final java.lang.String getLocalNsURI(int index)
Specified by:
getLocalNsURI in class InputElementStack