|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ORG.oclc.xml.om.ElementImpl
This class represents the default implementation of the Element
interface.
These are
created by the XML parser when using the default element factory.
Element
,
Parser
,
ElementFactory
,
ElementFactoryImpl
Field Summary | |
protected Attributes |
attrlist
The attribute list. |
Constructor Summary | |
ElementImpl()
|
|
ElementImpl(Name tag,
int type)
|
Method Summary | |
void |
addChild(Element elem,
Element after)
Adds a child to this element. |
void |
addChild(Element elem,
int pos,
int reserved)
Adds a child to this element. |
Object |
getAttribute(Name attrName)
Retrieves an attribute's value given its name. |
Object |
getAttribute(String name)
Retrieves an attribute's value given its name. |
Enumeration |
getAttributes()
Retrieves an enumeration for the element attributes. |
Element |
getChild(int index)
Retrieves the child element by index. |
ElementCollection |
getChildren()
Returns an element collection of the children of this element. |
Enumeration |
getElements()
Returns an enumeration of the children of this element. |
Element |
getParent()
Retrieves the parent of this element. |
Name |
getTagName()
Retrieves the name of the tag as a string. |
String |
getText()
Returns the non-marked-up text contained by this element. |
int |
getType()
Retrieves the type of the element. |
boolean |
isAttributeQualified(Name attr,
DTD dtd)
Determines if the attribute is qualified. |
int |
numAttributes()
Retrieves the number of attributes. |
int |
numElements()
Retrieves the number of child elements. |
Name |
qualifyName(String string)
This is a useful method for creating a qualified Name object from the given string. |
void |
removeAttribute(Name attrName)
Deletes an attribute from an element. |
void |
removeAttribute(String name)
Deletes an attribute from an element. |
void |
removeChild(Element elem)
Removes a child element from the tree. |
void |
save(XMLOutputStream o)
Saves the element in XML format. |
void |
saveAttributes(Atom ns,
XMLOutputStream o)
Save the element attributes in XML format |
void |
setAttribute(Name attrName,
Object value)
Sets the attribute of this element. |
void |
setAttribute(String name,
Object value)
Sets the attribute of this element. |
void |
setParent(Element parent)
Sets the parent of this element. |
void |
setText(String text)
Sets the text for this element. |
Element |
toSchema()
Returns the XML-DATA specification for the DTD element. |
String |
toString()
Retrieves the string representation of this element. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected Attributes attrlist
Constructor Detail |
public ElementImpl()
public ElementImpl(Name tag, int type)
Method Detail |
public Name getTagName()
public int getType()
DOCUMENT
, ELEMENT
, PCDATA
, PI
,
META
, COMMENT
, or CDATA
.public String getText()
Document.getText
returns "William Shakespeare".
public void setText(String text)
CDATA
, PCDATA
, and COMMENT
nodes.The
- text to set.public Element getParent()
public void setParent(Element parent)
parent
- The element to set as the parent.public Enumeration getElements()
Enumeration.nextElement
returns Element
objects.EnumWrapper for an easy way to return an empty enumeration.
public ElementCollection getChildren()
EnumWrapper
for an empty enumeration.public int numAttributes()
public int numElements()
public void addChild(Element elem, Element after)
elem
- The element to add.
The child element becomes the last element if after is null.
The child is added to the beginning of the list if after is this object.after
- The element after which to add it.public void addChild(Element elem, int pos, int reserved)
elem
- The element to add.pos
- The position to add this element (calling getChild(pos)
will return this element). If pos is less than 0, elem becomes
the new last element.reserved
- The reserved parameter.public Element getChild(int index)
index
- The index of the child element.public void removeChild(Element elem)
elem
- The element to remove.public Enumeration getAttributes()
Attribute
objects.EnumWrapper
for returning empty enumerations).Attribute
public Object getAttribute(String name)
name
- The name of the attribute.public Object getAttribute(Name attrName)
name
- The name of the attribute.public void setAttribute(String name, Object value)
name
- The attribute name.value
- The attribute value.public void removeAttribute(String name)
name
- The attribute to delete.public void removeAttribute(Name attrName)
attrName
- The attribute name to delete.public String toString()
public void setAttribute(Name attrName, Object value)
attrName
- The attribute name.value
- The attribute value.public void saveAttributes(Atom ns, XMLOutputStream o) throws IOException
public boolean isAttributeQualified(Name attr, DTD dtd)
attr
- The name of the attribute.dtd
- The Document Definition Type (DTD) in which the attribute
is found.public Element toSchema()
public void save(XMLOutputStream o) throws IOException
o
- The output stream to save to.public Name qualifyName(String string)
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |