GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse
Interface Element

All Known Subinterfaces:
CurrentElement
All Known Implementing Classes:
AbstractElement, CoroutineElement, MutableElement

public interface Element

Element, as presented to the application by the parser. Adds operators for getting XML attributes and other properties to the superinterface.


Method Summary
 boolean equals(Object obj)
           Define Element equality as identity of instances.
 Attribute getAttribute(QName qName)
           Get a single attribute.
 Attribute[] getAttributes()
           Get element attributes
 int getChildCount()
           Get the number of Elements entered as children of this Element.
 Element getParent()
           Get parent element.
 QName getQName()
           Get QName.
 int getRepeatCount()
           Get the number of previous occurrences of this Element at the same level, when this Element is one of a repeating sequence with the same name.
 int getSiblingCount()
           Get the number of previous siblings at the same level as this Element.
 boolean hasAncestor(QName name)
           Indicate whether the element has a named element as ancestor.
 int hashCode()
           Returns Object.hashCode.
 boolean hasParent(QName name)
           Indicate whether the element has a named element as parent.
 

Method Detail

getQName

QName getQName()

Get QName.

This identifies the Attribute by namespace and local name.

Returns:
QName.

getParent

Element getParent()

Get parent element.

Returns:
Parent element, or null when there is no parent.

getAttributes

Attribute[] getAttributes()

Get element attributes


getAttribute

Attribute getAttribute(QName qName)

Get a single attribute.


hasParent

boolean hasParent(QName name)

Indicate whether the element has a named element as parent.


hasAncestor

boolean hasAncestor(QName name)

Indicate whether the element has a named element as ancestor.


getChildCount

int getChildCount()

Get the number of Elements entered as children of this Element.

Includes the most recent child when invoked while in a descendent of the Element.

Returns:
zero at the beginning of an Element, the number of children at the end of an Element, or an intermediate value when invoked while in a descendant of the Element.

getSiblingCount

int getSiblingCount()

Get the number of previous siblings at the same level as this Element.

The current Element is not included in the count.

Returns:
number of siblings, or zero when this is the first element in the level

getRepeatCount

int getRepeatCount()

Get the number of previous occurrences of this Element at the same level, when this Element is one of a repeating sequence with the same name.

The current Element is not included in the count.

The count begins again after each change of name, unless the implementation documentation specifies otherwise.

Returns:
number of previous repetitions

equals

boolean equals(Object obj)

Define Element equality as identity of instances.

Overrides:
equals in class Object

hashCode

int hashCode()

Returns Object.hashCode.

Overrides:
hashCode in class Object

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License