Top Description Methods
org.codehaus.stax2

public Interface AttributeInfo

Known Direct Implementers
org.codehaus.stax2.ri.Stax2ReaderAdapter, org.codehaus.stax2.ri.Stax2ReaderImpl, org.codehaus.stax2.ri.dom.DOMWrappingReader

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 TypeMethod and Description
public int

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.
findAttributeIndex
(String nsURI, String localName)

public int

Returns:

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

public int

Returns:

Index of the ID attribute of current element, if the current element has such an attribute defined; -1 if not.
getIdAttributeIndex
()

Returns the index of the id attribute (attribute with any name, type ID from DTD) of current (start) element, if any.

public int

Returns:

Index of the NOTATION attribute of current element, if the current element has such an attribute defined; -1 if not.
getNotationAttributeIndex
()

Returns the index of the notation attribute (attribute with any name, type NOTATION from DTD) of current (start) element, if any.

Method Detail

findAttributeIndexback to summary
public int findAttributeIndex(String nsURI, String localName)
Returns:int

Index of the specified attribute, if the current element has such an attribute (explicit, or one created via default value expansion); -1 if not.

getAttributeCountback to summary
public int getAttributeCount()
Returns:int

Number of all attributes accessible (including ones created from the default values, if any) using this Object.

getIdAttributeIndexback to summary
public 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:int

Index of the ID attribute of current element, if the current element has such an attribute defined; -1 if not.

getNotationAttributeIndexback to summary
public 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:int

Index of the NOTATION attribute of current element, if the current element has such an attribute defined; -1 if not.