|
JXTA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jxta.impl.document.DOMXMLElement
public class DOMXMLElement
This class represent an element of an XML document. XML Documents are formed as a hierarchy of elements. Each element provides a proxy for DOM elements and the text nodes containing values.
| Field Summary | |
|---|---|
protected Node |
domNode
The DOM node for which this element is a proxy. |
protected DOMXMLDocument |
root
|
| Constructor Summary | |
|---|---|
protected |
DOMXMLElement(DOMXMLDocument root,
Node node)
Constructor for associating a DOM node with a StructuredDocument Element. |
| Method Summary | |
|---|---|
String |
addAttribute(Attribute newAttrib)
Adds an attribute with the given name and value. |
String |
addAttribute(String name,
String value)
Adds an attribute with the given name and value. |
void |
appendChild(DOMXMLElement element)
Add a child element to this element |
boolean |
equals(Object element)
Tests two elements for equality. |
protected Node |
getAssocNode()
Returns the DOM Node associated with this StructuredDocument element. |
Attribute |
getAttribute(String name)
returns a single attribute which matches the name provided. |
Enumeration<Attribute> |
getAttributes()
Returns an enumerations of the attributes assosicated with this object. |
Enumeration<DOMXMLElement> |
getChildren()
Returns an enumeration of the immediate children of this element |
Enumeration<DOMXMLElement> |
getChildren(Object key)
Returns an enumeration of the immediate children of this element whose name match the specified string. |
Enumeration<DOMXMLElement> |
getChildren(String name)
Returns an enumeration of the immediate children of this element whose name match the specified string. |
String |
getKey()
Get the name associated with an element. |
String |
getName()
Get the name associated with an element. |
DOMXMLElement |
getParent()
Get the parent of this element. |
DOMXMLDocument |
getRoot()
Get the root element of the hierarchy this element belongs to. |
String |
getTextValue()
Get the value (if any) associated with an element. |
String |
getValue()
Get the value (if any) associated with an element. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DOMXMLDocument root
protected Node domNode
| Constructor Detail |
|---|
protected DOMXMLElement(DOMXMLDocument root,
Node node)
root - the DOM not which is to be associated with this element.node - the DOM node| Method Detail |
|---|
public String getKey()
getKey in interface Element<DOMXMLElement>getKey in interface TextElement<DOMXMLElement>public String getValue()
getValue in interface Element<DOMXMLElement>getValue in interface TextElement<DOMXMLElement>public String getName()
getName in interface TextElement<DOMXMLElement>public String getTextValue()
getTextValue in interface TextElement<DOMXMLElement>public DOMXMLDocument getRoot()
getRoot in interface Element<DOMXMLElement>getRoot in interface TextElement<DOMXMLElement>getRoot in interface XMLElement<DOMXMLElement>public DOMXMLElement getParent()
getParent in interface Element<DOMXMLElement>public void appendChild(DOMXMLElement element)
appendChild in interface Element<DOMXMLElement>element - the element to be added as a childpublic Enumeration<DOMXMLElement> getChildren()
getChildren in interface Element<DOMXMLElement>public Enumeration<DOMXMLElement> getChildren(Object key)
getChildren in interface Element<DOMXMLElement>key - The key which will be matched against.
public Enumeration<DOMXMLElement> getChildren(String name)
getChildren in interface TextElement<DOMXMLElement>name - The name which will be matched against.
public boolean equals(Object element)
equals in class Objectelement - the element to be compared against.
protected Node getAssocNode()
public String addAttribute(String name,
String value)
addAttribute in interface Attributablename - name of the attribute.value - value for the attribute.
public String addAttribute(Attribute newAttrib)
addAttribute in interface AttributablenewAttrib - new attribute.
public Enumeration<Attribute> getAttributes()
getAttributes in interface Attributablepublic Attribute getAttribute(String name)
getAttribute in interface Attributablename - the attribute name
|
JXSE | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||