org.codehaus.staxmate.in
Class DefaultElementInfo

java.lang.Object
  extended by org.codehaus.staxmate.in.SMElementInfo
      extended by org.codehaus.staxmate.in.DefaultElementInfo

public class DefaultElementInfo
extends SMElementInfo

The default implementation of SMElementInfo; fully implements all accessors by storing information necessary.

Author:
Tatu Saloranta

Constructor Summary
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
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 class SMElementInfo

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 class SMElementInfo

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 class SMElementInfo

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 class SMElementInfo

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 class SMElementInfo

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 class SMElementInfo

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 class SMElementInfo

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 class SMElementInfo
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)