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) int
mDepth
(package private) int
mElemIndex
(package private) java.lang.String
mLocalName
(package private) int
mNodeIndex
(package private) java.lang.String
mNsURI
(package private) SMElementInfo
mParentElem
(package private) java.lang.String
mPrefix
(package private) SMElementInfo
mPrevSiblingElem
-
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 int
getDepth()
Optional operation that will return number of parent start elements this element has, if any.int
getElementIndex()
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.String
getLocalName()
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.String
getNamespaceURI()
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.int
getNodeIndex()
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.SMElementInfo
getParent()
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.String
getPrefix()
Optional operation that will return the prefix of the element, if it had one and namespace support was enabled for the parser.SMElementInfo
getPreviousSibling()
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:SMElementInfo
Optional 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:
getParent
in classSMElementInfo
-
getPreviousSibling
public SMElementInfo getPreviousSibling()
Description copied from class:SMElementInfo
Optional 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:
getPreviousSibling
in classSMElementInfo
-
getNodeIndex
public int getNodeIndex()
Description copied from class:SMElementInfo
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. If not implemented, needs to return -1.- Specified by:
getNodeIndex
in classSMElementInfo
-
getElementIndex
public int getElementIndex()
Description copied from class:SMElementInfo
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. 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:
getElementIndex
in classSMElementInfo
-
getDepth
public int getDepth()
Description copied from class:SMElementInfo
Optional operation that will return number of parent start elements this element has, if any. If not implemented, needs to return -1.- Specified by:
getDepth
in classSMElementInfo
-
getNamespaceURI
public java.lang.String getNamespaceURI()
Description copied from class:SMElementInfo
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. If operation is not implemented, needs to return null.- Specified by:
getNamespaceURI
in classSMElementInfo
-
getLocalName
public java.lang.String getLocalName()
Description copied from class:SMElementInfo
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. If operation is not implemented, needs to return null.- Specified by:
getLocalName
in classSMElementInfo
-
getPrefix
public java.lang.String getPrefix()
Description copied from class:SMElementInfo
Optional 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:
getPrefix
in 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)
-
-