Class DefaultElementInfo

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

public class DefaultElementInfo extends SMElementInfo
The default implementation of SMElementInfo; fully implements all accessors by storing information necessary.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (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

    Constructors
    Constructor
    Description
    DefaultElementInfo(SMElementInfo parent, SMElementInfo prevSibling, String prefix, String nsURI, String localName, int nodeIndex, int elemIndex, int depth)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mParentElem

      final SMElementInfo mParentElem
    • mPrevSiblingElem

      final SMElementInfo mPrevSiblingElem
    • mNsURI

      final String mNsURI
    • mLocalName

      final String mLocalName
    • mPrefix

      final String mPrefix
    • mNodeIndex

      final int mNodeIndex
    • mElemIndex

      final int mElemIndex
    • mDepth

      final int mDepth
  • Constructor Details

  • Method Details

    • 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 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 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 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)