|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.vex.dom.Node | +--net.sf.vex.dom.Element
Element
represents a tag in an XML document. Methods
are available for managing the element's attributes and children.
Nested Class Summary | |
class |
Element.AttributeChangeEdit
Represents an insertion of text into the document. |
Constructor Summary | |
Element(java.lang.String name)
Class constructor. |
Method Summary | |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of an attribute given its name. |
java.lang.String[] |
getAttributeNames()
Returns an array of names of the attributes in the element. |
Element[] |
getChildElements()
Returns an array of the elements children. |
java.util.Iterator |
getChildIterator()
Returns an iterator over the children. |
Node[] |
getChildNodes()
Returns an array of nodes representing the content of this element. |
Document |
getDocument()
|
java.lang.String |
getName()
Returns the name of the element. |
Element |
getParent()
Returns the parent of this element, or null if this is the root element. |
boolean |
isEmpty()
Returns true if the element has no content. |
javax.swing.undo.UndoableEdit |
removeAttribute(java.lang.String name)
Removes the given attribute from the array. |
javax.swing.undo.UndoableEdit |
setAttribute(java.lang.String name,
java.lang.String value)
Sets the value of an attribute for this element. |
void |
setParent(Element parent)
Sets the parent of this element. |
java.lang.String |
toString()
|
Methods inherited from class net.sf.vex.dom.Node |
getContent, getEndOffset, getEndPosition, getStartOffset, getStartPosition, getText |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Element(java.lang.String name)
name
- element nameMethod Detail |
public java.lang.String getAttribute(java.lang.String name)
name
- Name of the attribute.public java.lang.String[] getAttributeNames()
public java.util.Iterator getChildIterator()
Document.delete
to safely delete children.
public Element[] getChildElements()
public Node[] getChildNodes()
Text
objects.
public Document getDocument()
public java.lang.String getName()
public Element getParent()
public boolean isEmpty()
public javax.swing.undo.UndoableEdit removeAttribute(java.lang.String name) throws DocumentValidationException
name
- name of the attribute to remove.
DocumentValidationException
public javax.swing.undo.UndoableEdit setAttribute(java.lang.String name, java.lang.String value) throws DocumentValidationException
name
- Name of the attribute to be set.value
- New value for the attribute. If null, this call
has the same effect as removeAttribute(name).
DocumentValidationException
public void setParent(Element parent)
parent
- Parent element.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |