Branch interface defines the common behaviour for Nodes which
can contain child nodes (content) such as XML elements and documents. This
interface allows both elements and documents to be treated in a polymorphic
manner when changing or navigating child nodes (content).
| Modifier and Type | Method and Description |
|---|---|
| public void | add(Node
is the given node to add node)Adds the given |
| public void | |
| public void | |
| public void | add(ProcessingInstruction
is the processing instruction to be added pi)Adds the given |
| public Element | Returns: the newly addedElement node.is the name for the name)Element node.Adds a new |
| public Element | Returns: the newly addedElement node.is the qualified name for the qname)Element node.Adds a new |
| public Element | Returns: the newly addedElement node.is the fully qualified name of the Element qualifiedName, String is the URI of the namespace to use namespaceURI)Adds a new |
| public void | appendContent(Branch
is the branch whose content will be added to me. branch)Appends the content of the given branch to this branch instance. |
| public void | clearContent()
Clears the content for this branch, removing any |
| public List | |
| public Element | Returns: DOCUMENT ME!DOCUMENT ME! elementID)Returns the element of the given ID attribute value. |
| public int | |
| public Node | Returns: theNode at the specified position.the index of the node to return. index)Returns the |
| public int | Returns: the number of nodes this branch containsReturns the number of |
| public Iterator | Returns: an iterator through the content nodes of this branchReturns an iterator through the content nodes of this branch |
| public void | normalize()
Puts all |
| public ProcessingInstruction | Returns: the processing instruction for the given targetDOCUMENT ME! target)DOCUMENT ME! |
| public List | Returns: a backed list of the processing instructionsReturns a list of all the processing instructions in this branch. |
| public List | Returns: a backed list of the processing instructionsDOCUMENT ME! target)Returns a list of the processing instructions for the given target. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if the processing instruction was removedis the processing instruction to be removed pi)Removes the given |
| public boolean | Returns: true if a processing instruction was removed else falseDOCUMENT ME! target)Removes the processing instruction for the given target if it exists |
| public void | setContent(List<Node>
is the list of nodes to use as the content for this branch. content)Sets the contents of this branch as a |
| public void | setProcessingInstructions(List<ProcessingInstruction>
DOCUMENT ME! listOfPIs)Sets all the processing instructions for this branch |
| add | back to summary |
|---|---|
| public void add(Node node) Adds the given
| |
| add | back to summary |
|---|---|
| public void add(Comment comment) Adds the given
| |
| add | back to summary |
|---|---|
| public void add(Element element) Adds the given
| |
| add | back to summary |
|---|---|
| public void add(ProcessingInstruction pi) Adds the given
| |
| addElement | back to summary |
|---|---|
| public Element addElement(String name) Adds a new | |
| addElement | back to summary |
|---|---|
| public Element addElement(QName qname) Adds a new | |
| addElement | back to summary |
|---|---|
| public Element addElement(String qualifiedName, String namespaceURI) Adds a new | |
| appendContent | back to summary |
|---|---|
| public void appendContent(Branch branch) Appends the content of the given branch to this branch instance. This
method behaves like the
| |
| clearContent | back to summary |
|---|---|
| public void clearContent() Clears the content for this branch, removing any | |
| content | back to summary |
|---|---|
| public List Returns the content nodes of this branch as a backed | |
| elementByID | back to summary |
|---|---|
| public Element elementByID(String elementID) Returns the element of the given ID attribute value. If this tree is capable of understanding which attribute value should be used for the ID then it should be used, otherwise this method should return null. | |
| indexOf | back to summary |
|---|---|
| public int indexOf(Node node) Returns the index of the given node if it is a child node of this branch or -1 if the given node is not a child node.
| |
| node | back to summary |
|---|---|
| public Node node(int index) throws IndexOutOfBoundsException Returns the
| |
| nodeCount | back to summary |
|---|---|
| public int nodeCount() Returns the number of
| |
| nodeIterator | back to summary |
|---|---|
| public Iterator Returns an iterator through the content nodes of this branch | |
| normalize | back to summary |
|---|---|
| public void normalize() Puts all
| |
| processingInstruction | back to summary |
|---|---|
| public ProcessingInstruction processingInstruction(String target) DOCUMENT ME!
| |
| processingInstructions | back to summary |
|---|---|
| public List Returns a list of all the processing instructions in this branch. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.
| |
| processingInstructions | back to summary |
|---|---|
| public List Returns a list of the processing instructions for the given target. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Node node) Removes the given
| |
| remove | back to summary |
|---|---|
| public boolean remove(Comment comment) Removes the given
| |
| remove | back to summary |
|---|---|
| public boolean remove(Element element) Removes the given
| |
| remove | back to summary |
|---|---|
| public boolean remove(ProcessingInstruction pi) Removes the given
| |
| removeProcessingInstruction | back to summary |
|---|---|
| public boolean removeProcessingInstruction(String target) Removes the processing instruction for the given target if it exists
| |
| setContent | back to summary |
|---|---|
| public void setContent(List<Node> content) Sets the contents of this branch as a | |
| setProcessingInstructions | back to summary |
|---|---|
| public void setProcessingInstructions(List<ProcessingInstruction> listOfPIs) Sets all the processing instructions for this branch
| |