|
GXPARSE hosted by |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.gorman.xml.parse.toolkit.AbstractElement
public abstract class AbstractElement
Abstract realization of Element
.
This is a common base class for the parser's internal view of Element objects and the application programmer's external view of Element objects. Elements are presented to the application programmer as immutable objects, but are treated as mutable objects inside the parser. The mutable version is created by subclassing to expose the setters.
Constructor Summary | |
---|---|
protected |
AbstractElement()
Create an uninitialized AbstractElement. |
protected |
AbstractElement(Element element)
Create an initialized AbstractElement. |
protected |
AbstractElement(QName qName)
Create a named AbstractElement with empty attribute list. |
protected |
AbstractElement(QName qName,
Attribute[] attributes)
Create an initialized AbstractElement. |
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 Element s 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 qName)
Indicate whether the element has a named element as ancestor. |
int |
hashCode()
Returns Object.hashCode . |
boolean |
hasParent(QName qName)
Indicate whether the element has a named element as parent. |
AbstractElement |
newInstance(QName qName,
Attribute[] attributes)
Create an immutable AbstractElement. |
protected void |
setAttribute(Attribute attribute)
Set or replace a single Attribute |
protected void |
setAttributes(Attribute[] attribute)
Set or replace the entire list of attributes. |
protected void |
setParent(AbstractElement parent)
Set or replace the parent element. |
protected void |
setQName(QName qName)
Set element name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractElement(QName qName, Attribute[] attributes)
Create an initialized AbstractElement.
protected AbstractElement(Element element)
Create an initialized AbstractElement.
protected AbstractElement(QName qName)
Create a named AbstractElement with empty attribute list.
protected AbstractElement()
Create an uninitialized AbstractElement.
Method Detail |
---|
public AbstractElement newInstance(QName qName, Attribute[] attributes)
Create an immutable AbstractElement.
public final QName getQName()
Element
Get QName
.
This identifies the Attribute
by namespace and local name.
getQName
in interface Element
public final Attribute getAttribute(QName qName)
Element
Get a single attribute.
getAttribute
in interface Element
public final Attribute[] getAttributes()
Element
Get element attributes
getAttributes
in interface Element
public final Element getParent()
Element
Get parent element.
getParent
in interface Element
public final boolean hasParent(QName qName)
Element
Indicate whether the element has a named element as parent.
hasParent
in interface Element
public final boolean hasAncestor(QName qName)
Element
Indicate whether the element has a named element as ancestor.
hasAncestor
in interface Element
public final int getChildCount()
Element
Get the number of Element
s entered as children of this
Element
.
Includes the most recent child when invoked while in a descendent of the
Element
.
getChildCount
in interface Element
Element
, the number of
children at the end of an Element
, or an
intermediate value when invoked while in a descendant of the
Element
.public final int getSiblingCount()
Element
Get the number of previous siblings at the same level as this
Element
.
The current Element
is not included in the count.
getSiblingCount
in interface Element
public final int getRepeatCount()
Element
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.
getRepeatCount
in interface Element
public final boolean equals(Object obj)
Element
Define Element
equality as identity of instances.
equals
in interface Element
equals
in class Object
public final int hashCode()
Element
Returns Object.hashCode
.
hashCode
in interface Element
hashCode
in class Object
protected void setQName(QName qName)
Set element name.
NullPointerException
- if qName is nullprotected void setAttribute(Attribute attribute)
Set or replace a single Attribute
NullPointerException
- if attribute is nullprotected void setAttributes(Attribute[] attribute)
Set or replace the entire list of attributes.
NullPointerException
- if attribute is nullprotected void setParent(AbstractElement parent)
Set or replace the parent element.
|
GXPARSE download | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |