Interface AttributeInfo

All Known Implementing Classes:
DOMWrappingReader, Stax2ReaderAdapter, Stax2ReaderImpl

public interface AttributeInfo
Interface that specifies additional access methods for accessing combined attribute information reader has, after parsing individual and combining that with DTD information (if any available; depends on parser's mode).

Note: instances of AttributeInfo are only guaranteed to persist as long as the (stream) reader points to the START_ELEMENT event, during which attribute information was parsed. It is possible that some implementations persist instances afterwards, but it's equally possible that instances get reused, and as such information may change.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    findAttributeIndex(String nsURI, String localName)
     
    int
     
    int
    Returns the index of the id attribute (attribute with any name, type ID from DTD) of current (start) element, if any.
    int
    Returns the index of the notation attribute (attribute with any name, type NOTATION from DTD) of current (start) element, if any.
  • Method Details

    • getAttributeCount

      int getAttributeCount()
      Returns:
      Number of all attributes accessible (including ones created from the default values, if any) using this Object.
    • findAttributeIndex

      int findAttributeIndex(String nsURI, String localName)
      Returns:
      Index of the specified attribute, if the current element has such an attribute (explicit, or one created via default value expansion); -1 if not.
    • getIdAttributeIndex

      int getIdAttributeIndex()
      Returns the index of the id attribute (attribute with any name, type ID from DTD) of current (start) element, if any. Note that DTD only allows at most one such attribute per element.
      Returns:
      Index of the ID attribute of current element, if the current element has such an attribute defined; -1 if not.
    • getNotationAttributeIndex

      int getNotationAttributeIndex()
      Returns the index of the notation attribute (attribute with any name, type NOTATION from DTD) of current (start) element, if any. Note that DTD only allows at most one such attribute per element.
      Returns:
      Index of the NOTATION attribute of current element, if the current element has such an attribute defined; -1 if not.