|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.xml.Node
electric.xml.Child
electric.xml.Parent
Parent is the abstract root of all nodes that can have children, and includes methods for adding and accessing child nodes.
Field Summary | |
protected NodeList |
children
|
Fields inherited from class electric.xml.Child |
parent |
Fields inherited from class electric.xml.Node |
list, next, prev |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Fields inherited from interface electric.xml.IXMLConstants |
ATTLIST_START, ATTLIST_STOP, CDATA, CDATA_START, CDATA_STOP, CLOSE_TAG, COLON, COMMENT_START, COMMENT_STOP, DOCTYPE_START, DOCTYPE_STOP, ELEMENTDECL_START, ELEMENTDECL_STOP, ENCODING, ENTITYDECL_START, ENTITYDECL_STOP, ID, ID_CASE, INSTRUCTION_START, INSTRUCTION_STOP, NEGATIVE_INFINITY, NOT_A_NUMBER, NOTATIONDECL_START, NOTATIONDECL_STOP, NULL, OPEN_TAG, POSITIVE_INFINITY, PUBLIC, SPECIALS, STANDALONE, SUBSTITUTES, SYSTEM, UNDEFINED, VERSION, XML, XML_NAMESPACE, XMLDECL_START, XMLDECL_STOP, XMLNS, XMLNS_NAMESPACE |
Fields inherited from interface electric.xml.IDOMConstants |
CDATA_SECTION_NAME, COMMENT_NAME, CORE, DOCUMENT_FRAGMENT_NAME, DOCUMENT_NAME, HIERARCHY_REQUEST_ERR, TEXT_NAME |
Constructor Summary | |
Parent()
Construct a Parent with no children. |
|
Parent(Parent parent)
Construct a copy of the specified Parent. |
Method Summary | |
Child |
addChild(Child child)
Add the specified child to my list of children and return the child. |
void |
addComment(java.lang.String text)
Add a Comment node with the specified text. |
Element |
addElement()
Add a new Element with no name. |
Element |
addElement(Element element)
Add the specified Element. |
Element |
addElement(java.lang.String name)
Add a new Element with the specified name. |
Element |
addElement(java.lang.String prefix,
java.lang.String name)
Add a new Element with the specified namespace prefix name. |
protected void |
addNamespacePrefixes(java.lang.String namespace,
java.util.Vector prefixes,
java.util.Vector matches)
Add all the prefixes that map to a particular namespace value in my context to the specified vector. |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of children of this node. |
org.w3c.dom.NodeList |
getChildNodes()
Return a NodeList that contains all children of this node. |
Children |
getChildren()
Return an enumeration over my children. |
Element |
getElement(IXPath xpath)
Return my first Element node with the specified xpath, or null if I have none. |
Element |
getElement(java.lang.String name)
Return my first Element node with the specified name, or null if I have none. |
Element |
getElement(java.lang.String namespace,
java.lang.String name)
Return my first Element node with the specified namespace and name, or null if I have none. |
Element |
getElementAt(int index)
Return the Element node at the specified index, using 1 as the base index for Xpath compatibility. |
Elements |
getElements()
Return an enumeration of my child Elements. |
Elements |
getElements(IXPath xpath)
Return an enumeration over all my Elements with the specified xpath. |
Elements |
getElements(java.lang.String name)
Return an enumeration over all my Elements with the specified name. |
Elements |
getElements(java.lang.String namespace,
java.lang.String name)
Return an enumeration over all my Elements with the specified namespace and name. |
Element |
getElementWithId(java.lang.String value)
Return the element whose "id" attribute is equal to the specified value, or null if none exists. |
org.w3c.dom.Node |
getFirstChild()
Return the first child of this node. |
Element |
getFirstElement()
Return the first Element, or null if there is none. |
org.w3c.dom.Node |
getLastChild()
Return the last child of this node. |
java.lang.String |
getNamespace(java.lang.String prefix)
Return the value of the namespace with the specified prefix, or null if there is none. |
java.lang.String |
getNamespacePrefix(java.lang.String namespace)
Return a prefix that maps to a particular namespace value, searching from the current element up through its parents. |
boolean |
hasChildNodes()
Returns whether this node has any children. |
boolean |
hasChildren()
Return true if I have one or more children. |
boolean |
hasElement(java.lang.String name)
Return true if I have an Element with the specified name. |
boolean |
hasElements()
Return true if I have one or more child Elements. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Inserts the node newChild before the existing child node refChild. |
Child |
insertChild(Child child)
Insert the specified child to my list of children and return the child. |
void |
insertComment(java.lang.String text)
Insert a Comment node with the specified text. |
Element |
insertElement()
Insert a new Element with no name. |
Element |
insertElement(Element element)
Insert the specified Element. |
Element |
insertElement(java.lang.String name)
Insert a new Element with the specified name. |
Element |
insertElement(java.lang.String prefix,
java.lang.String name)
Insert a new Element with the specified namespace prefix name. |
protected Element |
needElement(java.lang.String name)
|
protected Element |
needElement(java.lang.String namespace,
java.lang.String name)
|
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Removes the child node indicated by oldChild from the list of children, and returns it. |
void |
removeChildren()
Remove all of my children. |
Element |
removeElement(IXPath xpath)
Remove and return the first element with the specified xpath, or return null if none was found. |
Element |
removeElement(java.lang.String name)
Remove and return the first element with the specified name, or return null if none was found. |
Element |
removeElement(java.lang.String namespace,
java.lang.String name)
Remove and return the first element with the specified namespace and name, or return null if none was found. |
Element |
removeElementAt(int index)
Remove and return the Element node at the specified index, using 1 as the base index for Xpath compatibility. |
void |
removeElements()
Remove all the elements. |
Elements |
removeElements(IXPath xpath)
Remove and return an enumeration over the elements with the specified xpath. |
Elements |
removeElements(java.lang.String name)
Remove and return an enumeration over the elements with the specified name. |
Elements |
removeElements(java.lang.String namespace,
java.lang.String name)
Remove and return an enumeration over the elements with the specified namespace and name. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. |
Element |
setElement(java.lang.String name)
Add a new Element with the specified name, replacing an existing one if present. |
Element |
setElement(java.lang.String prefix,
java.lang.String name)
Add a new Element with the specified namespace prefix name, replacing an existing one if present. |
Element |
setElementAt(int index,
Element element)
Set the element node at the specified index, using 1 as the base index for Xpath compatibility, and return the previous value. |
int |
size()
|
Methods inherited from class electric.xml.Child |
clone, cloneNode, getByteArray, getByteArray, getByteArray, getBytes, getBytes, getBytes, getDocument, getNextSiblingChild, getOwnerDocument, getParent, getParentNode, getPreviousSiblingChild, getRoot, replaceWith, setNextSiblingChild, setParent, setPreviousSiblingChild, toString, toString, write, write, write |
Methods inherited from class electric.xml.Node |
getAttributes, getLocalName, getNamespaceURI, getNextSibling, getNextSiblingNode, getNode, getNode, getNodeName, getNodes, getNodeType, getNodeValue, getPrefix, getPreviousSibling, getPreviousSiblingNode, hasAttributes, isSupported, normalize, read, remove, setNextSiblingNode, setNodeValue, setPrefix, setPreviousSiblingNode, write |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected NodeList children
Constructor Detail |
public Parent()
public Parent(Parent parent)
parent
- The parent to copy.Method Detail |
public boolean hasChildren()
public Children getChildren()
public void removeChildren()
public Child addChild(Child child)
child
- The child.public Child insertChild(Child child)
child
- The child.public java.lang.String getNamespace(java.lang.String prefix)
prefix
- The prefix.protected void addNamespacePrefixes(java.lang.String namespace, java.util.Vector prefixes, java.util.Vector matches)
namespace
- The namespace to matchprefixes
- All the prefixes so far.matches
- All the prefixes that matched.public java.lang.String getNamespacePrefix(java.lang.String namespace)
namespace
- The namespace to match.public void addComment(java.lang.String text)
text
- The text.public void insertComment(java.lang.String text)
text
- The text.public boolean hasElements()
public Elements getElements()
public Element getElement(java.lang.String name)
name
- The name.public Element getElement(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public Element getElement(IXPath xpath)
xpath
- The XPath.public boolean hasElement(java.lang.String name)
name
- The name.public Element getElementAt(int index) throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
- If the index was illegal.public Element getFirstElement()
public Element setElementAt(int index, Element element) throws java.lang.IndexOutOfBoundsException
index
- The index.element
- The element.
java.lang.IndexOutOfBoundsException
- If the index was illegal.public Element setElement(java.lang.String name)
name
- The name of the Element to add.
public Element setElement(java.lang.String prefix, java.lang.String name)
prefix
- The namespace prefix.name
- The name of the Element to add.
public Element removeElementAt(int index)
index
- The index.
java.lang.IndexOutOfBoundsException
- If the index was illegal.public Elements getElements(java.lang.String name)
name
- The name.public Elements getElements(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public Elements getElements(IXPath xpath)
xpath
- The XPath.public Element addElement(Element element)
element
- The Element.
public Element addElement()
public Element addElement(java.lang.String name)
name
- The name of the Element to add.
public Element addElement(java.lang.String prefix, java.lang.String name)
prefix
- The namespace prefix.name
- The name of the Element to add.
public Element insertElement(Element element)
element
- The Element.
public Element insertElement()
public Element insertElement(java.lang.String name)
name
- The name of the Element to add.
public Element insertElement(java.lang.String prefix, java.lang.String name)
prefix
- The namespace prefix.name
- The name of the Element to add.
public void removeElements()
public Element removeElement(java.lang.String name)
name
- The name.public Element removeElement(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public Element removeElement(IXPath xpath)
xpath
- The XPath.public Elements removeElements(java.lang.String name)
name
- The name.public Elements removeElements(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public Elements removeElements(IXPath xpath)
xpath
- The XPath.protected Element needElement(java.lang.String name) throws java.lang.NumberFormatException
name
- The name.
java.lang.NumberFormatException
protected Element needElement(java.lang.String namespace, java.lang.String name) throws java.lang.NumberFormatException
namespace
- The namespace.name
- The name.
java.lang.NumberFormatException
public Element getElementWithId(java.lang.String value)
value
- public int size()
size
in class Node
public boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
hasChildNodes
in class Node
public org.w3c.dom.NodeList getChildNodes()
getChildNodes
in interface org.w3c.dom.Node
getChildNodes
in class Node
public org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
getFirstChild
in class Node
public org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
getLastChild
in class Node
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
appendChild
in interface org.w3c.dom.Node
appendChild
in class Node
newChild
- The node to add.If it is a DocumentFragment object, the
entire contents of the document fragment are moved into the child list of this nodepublic org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
removeChild
in interface org.w3c.dom.Node
removeChild
in class Node
oldChild
- The node being removed.public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
insertBefore
in interface org.w3c.dom.Node
insertBefore
in class Node
newChild
- The node to insert.refChild
- The reference node, i.e., the node before which the new node must be inserted.public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
replaceChild
in interface org.w3c.dom.Node
replaceChild
in class Node
newChild
- The new node to put in the child list.oldChild
- The node being replaced in the list.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |