Package org.codehaus.staxmate.in
Class DefaultElementInfo
- java.lang.Object
-
- org.codehaus.staxmate.in.SMElementInfo
-
- org.codehaus.staxmate.in.DefaultElementInfo
-
public class DefaultElementInfo extends SMElementInfo
The default implementation ofSMElementInfo; fully implements all accessors by storing information necessary.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intmDepth(package private) intmElemIndex(package private) java.lang.StringmLocalName(package private) intmNodeIndex(package private) java.lang.StringmNsURI(package private) SMElementInfomParentElem(package private) java.lang.StringmPrefix(package private) SMElementInfomPrevSiblingElem
-
Constructor Summary
Constructors Constructor Description DefaultElementInfo(SMElementInfo parent, SMElementInfo prevSibling, java.lang.String prefix, java.lang.String nsURI, java.lang.String localName, int nodeIndex, int elemIndex, int depth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDepth()Optional operation that will return number of parent start elements this element has, if any.intgetElementIndex()Optional operation that will return the zero-based index of the element amongst all (start) elements iterated over by the iterator that created this element info object.java.lang.StringgetLocalName()Optional operation that will return the local name of the element, or, if namespace support was not enabled for the parser, full name including possible namespace prefix.java.lang.StringgetNamespaceURI()Optional operation that will return the URI of the namespace of the element; this will be empty String ("") for the default namespace (if none declared), or if namespace support was not enabled for the parser.intgetNodeIndex()Optional operation that will return the zero-based index of the element node amongst all nodes iterated over by the iterator that created this element info object.SMElementInfogetParent()Optional operation that will return information about the parent element of this element, if one exists; null if not (case for the root element).java.lang.StringgetPrefix()Optional operation that will return the prefix of the element, if it had one and namespace support was enabled for the parser.SMElementInfogetPreviousSibling()Optional operation that will return information about the previous sibling in the sibling element chain.-
Methods inherited from class org.codehaus.staxmate.in.SMElementInfo
isFirstChild, isRoot
-
-
-
-
Field Detail
-
mParentElem
final SMElementInfo mParentElem
-
mPrevSiblingElem
final SMElementInfo mPrevSiblingElem
-
mNsURI
final java.lang.String mNsURI
-
mLocalName
final java.lang.String mLocalName
-
mPrefix
final java.lang.String mPrefix
-
mNodeIndex
final int mNodeIndex
-
mElemIndex
final int mElemIndex
-
mDepth
final int mDepth
-
-
Constructor Detail
-
DefaultElementInfo
public DefaultElementInfo(SMElementInfo parent, SMElementInfo prevSibling, java.lang.String prefix, java.lang.String nsURI, java.lang.String localName, int nodeIndex, int elemIndex, int depth) throws javax.xml.stream.XMLStreamException
- Throws:
javax.xml.stream.XMLStreamException
-
-
Method Detail
-
getParent
public SMElementInfo getParent()
Description copied from class:SMElementInfoOptional operation that will return information about the parent element of this element, if one exists; null if not (case for the root element). If not implemented, needs to return null- Specified by:
getParentin classSMElementInfo
-
getPreviousSibling
public SMElementInfo getPreviousSibling()
Description copied from class:SMElementInfoOptional operation that will return information about the previous sibling in the sibling element chain. Depending on iterator, this may contain only those elements iterator returned (that filter accepted), or all elements iterator traversed over. If not implemented, needs to return null- Specified by:
getPreviousSiblingin classSMElementInfo
-
getNodeIndex
public int getNodeIndex()
Description copied from class:SMElementInfoOptional operation that will return the zero-based index of the element node amongst all nodes iterated over by the iterator that created this element info object. If not implemented, needs to return -1.- Specified by:
getNodeIndexin classSMElementInfo
-
getElementIndex
public int getElementIndex()
Description copied from class:SMElementInfoOptional operation that will return the zero-based index of the element amongst all (start) elements iterated over by the iterator that created this element info object. If not implemented, needs to return -1.Note that the element indices for consequtive elements stored may not be consequtive, if the iterator filtered out some elements.
- Specified by:
getElementIndexin classSMElementInfo
-
getDepth
public int getDepth()
Description copied from class:SMElementInfoOptional operation that will return number of parent start elements this element has, if any. If not implemented, needs to return -1.- Specified by:
getDepthin classSMElementInfo
-
getNamespaceURI
public java.lang.String getNamespaceURI()
Description copied from class:SMElementInfoOptional operation that will return the URI of the namespace of the element; this will be empty String ("") for the default namespace (if none declared), or if namespace support was not enabled for the parser. If operation is not implemented, needs to return null.- Specified by:
getNamespaceURIin classSMElementInfo
-
getLocalName
public java.lang.String getLocalName()
Description copied from class:SMElementInfoOptional operation that will return the local name of the element, or, if namespace support was not enabled for the parser, full name including possible namespace prefix. If operation is not implemented, needs to return null.- Specified by:
getLocalNamein classSMElementInfo
-
getPrefix
public java.lang.String getPrefix()
Description copied from class:SMElementInfoOptional operation that will return the prefix of the element, if it had one and namespace support was enabled for the parser. Otherwise will return null. If operation is not implemented, needs to return null.- Specified by:
getPrefixin classSMElementInfo- Returns:
- Namespace prefix of the element; or null if either name space support was not enabled, or if the element had no namespace prefix (ie. uses the default namespace)
-
-