Method Summary |
|
public synchronized List<Node> | add(Node parent, Node node, int offset) This api adds given node to given parent at given index.
The added node will be part of childnodes of the parent,
and its index will be the given index. |
public synchronized void | addPropertyChangeListener(PropertyChangeListener pcl) This api adds a property change listener. |
public synchronized void | addUndoableEditListener(UndoableEditListener l) This api adds an undoable edit listener. |
public synchronized List<Node> | append(Node parent, Node node) This api adds given node to given parent at the end.
The added node will be part of childnodes of the parent,
and it will be the last node.
Parameters: parent - The parent node to which the node is to be appended. Parameters: node - The node which is to be appended. |
public synchronized List<Node> | delete(Node n) This api deletes given node from a tree.
Parameters: node - The node to be deleted. |
public synchronized void | flush() This api flushes the changes made to the model to the underlying document. |
public synchronized Document | getCurrentDocument() This api returns the current document in the model, regardless of the state. |
public synchronized String | getCurrentDocumentText() |
public synchronized Document | getDocument() This api returns the latest stable document in the model. |
public ElementIdentity | getElementIdentity() |
public String | getIndentation() |
public int | getNextNodeId() This api keeps track of the nodes created in this model. |
public Map<QName, List<QName>> | getQNameValuedAttributes() |
public synchronized Status | getStatus() This returns the statuc of the model. |
public synchronized List<Node> | insertBefore(Node parent, Node node, Node refChild) This api adds given node to given parent before given ref node.
The inserted node will be part of childnodes of the parent,
and will appear before ref node.
Parameters: parent - The parent node to which the node is to be added. Parameters: node - The node which is to be added. Parameters: refChild - The ref node (child) of parent node,before which the node is to be added. |
public void | mergeDiff(List<Difference> diffs) |
public synchronized List<Node> | modify(Node oldValue, Node newValue) This api replaces given old node with given new node.
The old node passed must be in tree, the new node must not be in tree,
and new node must be clone of old node.
Parameters: oldValue - The old node to be replaced. Parameters: newValue - The new node. |
public synchronized void | prepareSync() |
public synchronized List<Node> | remove(Node parent, Node child) This api deletes given node from a given parent node.
Parameters: parent - The parent node from which the node is to be deleted. Parameters: child - The node to be deleted. |
public synchronized List<Node> | removeAttribute(Element element, String name) This api removes an attribute given name and value of a given element node.
Parameters: element - The element of which the attribute to be removed. Parameters: name - The name of the attribute to be removed. |
public synchronized List<Node> | removeChildNodes(Node parent, Collection<Node> toRemove) This api deletes given node from a given parent node.
Parameters: parent - The parent node from which the node is to be deleted. Parameters: toRemove - collection of node to be deleted. |
public synchronized void | removePropertyChangeListener(PropertyChangeListener pcl) This api removes a property change listener. |
public synchronized void | removeUndoableEditListener(UndoableEditListener l) This api removes an undoable edit listener. |
public synchronized List<Node> | reorder(Node parent, Node n, int index) This api changes index of the given node.
Parameters: nodes - The nodes to be moved. Parameters: indexes - the new indexes of the nodes. |
public synchronized List<Node> | reorderChildren(Node parent, int[] permutation) This api changes indexes of the given node children.
Parameters: nodes - The nodes to be moved. Parameters: indexes - the new indexes of the nodes. |
public synchronized List<Node> | replaceChild(Node parent, Node child, Node newChild) |
synchronized void | resetDocument(Document newDoc) Reset document to provided known version and cause events to be fired. |
public synchronized List<Node> | setAttribute(Element element, String name, String value) This api sets an attribute given name and value of a given element node.
If an attribute with given name already present in element, it will only
set the value. |
public synchronized void | setDocument(Document newDoc) |
public void | setElementIdentity(ElementIdentity eID) |
public void | setIndentation(String indent) |
public void | setPretty(boolean print) |
public void | setQNameValuedAttributes(Map<QName, List<QName>> attrsByElement) Set/get mapping of QName-valued attributes by element.
Key of the mapping is QName of the element.
Value of the mapping is list QName's of the attributes.
If the mapping is set, it will be used to identify the
attribute values affected by namespace prefix refactoring
during namespace consolidation. |
public synchronized List<Node> | setTextValue(Node node, String value) |
public synchronized List<Node> | setXmlFragmentText(Element node, String value) |
public synchronized void | sync() This api syncs the model with the underlying swing document.
If its the first time sync is called, swing document is parsed and model
is initialized. |