Package org.codehaus.staxmate.in
Class DefaultElementInfo
java.lang.Object
org.codehaus.staxmate.in.SMElementInfo
org.codehaus.staxmate.in.DefaultElementInfo
The default implementation of
SMElementInfo
; fully implements
all accessors by storing information necessary.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int
(package private) final int
(package private) final String
(package private) final int
(package private) final String
(package private) final SMElementInfo
(package private) final String
(package private) final SMElementInfo
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultElementInfo
(SMElementInfo parent, SMElementInfo prevSibling, String prefix, String nsURI, String localName, int nodeIndex, int elemIndex, int depth) -
Method Summary
Modifier and TypeMethodDescriptionint
getDepth()
Optional operation that will return number of parent start elements this element has, if any.int
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.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.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
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.Optional operation that will return information about the parent element of this element, if one exists; null if not (case for the root element).Optional operation that will return the prefix of the element, if it had one and namespace support was enabled for the parser.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 Details
-
mParentElem
-
mPrevSiblingElem
-
mNsURI
-
mLocalName
-
mPrefix
-
mNodeIndex
final int mNodeIndex -
mElemIndex
final int mElemIndex -
mDepth
final int mDepth
-
-
Constructor Details
-
DefaultElementInfo
public DefaultElementInfo(SMElementInfo parent, SMElementInfo prevSibling, String prefix, String nsURI, String localName, int nodeIndex, int elemIndex, int depth) throws XMLStreamException - Throws:
XMLStreamException
-
-
Method Details
-
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
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
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
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
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)
-