Modifier and Type | Field and Description |
---|---|
static String |
XMLNS |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Modifier and Type | Method and Description |
---|---|
void |
addedToTree(XDMModel model)
Marks the node and all its children added to a tree.
|
Node |
appendChild(Node node)
Adds the node newChild to the end of the list of children of this node.
|
void |
assignNodeId(int id) |
void |
assignNodeIdRecursively()
Recursively assigns node id's.
|
Node |
clone(boolean cloneContent,
boolean cloneAttributes,
boolean cloneChildren)
This api clones the node object and returns the clone.
|
protected void |
cloneNamespacePrefixes(Map<Integer,String> allNS,
Map<String,String> prefixes) |
Node |
cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
|
Node |
cloneNode(boolean deep,
boolean cloneNamespacePrefix) |
Node |
cloneNode(boolean deep,
Map<Integer,String> allNS,
Map<String,String> clonePrefixes) |
Node |
cloneShallowWithModelContext() |
short |
compareDocumentPosition(Node a) |
Node |
copy()
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
|
void |
copyTokens(Node newNode) |
NamedNodeMap |
getAttributes()
A NamedNodeMap that contains all attributes of this node.
|
protected List<Attribute> |
getAttributesForRead()
Returns a readonly List of all attributes of this node.
|
protected List<Attribute> |
getAttributesForWrite()
Returns a modifiable List of all attributes of this node for updates.
|
String |
getBaseURI() |
NodeList |
getChildNodes()
A NodeList that contains all children of this node.
|
Object |
getFeature(String a,
String b) |
Node |
getFirstChild()
The first child of this node.
|
int |
getId()
Returns the id of this node
|
int |
getIndexOfChild(Node n)
Lookup child index of given child based on node ID.
|
Node |
getLastChild()
The last child of this node.
|
String |
getLocalName() |
protected XDMModel |
getModel() |
String |
getNamespaceURI() |
String |
getNamespaceURI(Document document)
Returns namespace of this node in the given Document tree.
|
Node |
getNextSibling() |
abstract String |
getNodeName() |
abstract short |
getNodeType() |
String |
getNodeValue() |
Document |
getOwnerDocument()
The Document object associated with this node.
|
Node |
getParentNode() |
String |
getPrefix() |
Node |
getPreviousSibling() |
String |
getTextContent() |
List<Token> |
getTokens()
Returns the readonly lexical tokens associated with this node.
|
Object |
getUserData(String a) |
boolean |
hasAttributes()
Returns whether this node has any attributes.
|
boolean |
hasChildNodes()
Returns whether this node has any children.
|
int |
hashCode() |
Node |
insertBefore(Node newChild,
Node refChild)
Inserts the node newChild before the existing child node refChild.
|
boolean |
isDefaultNamespace(String a) |
boolean |
isEqualNode(Node a) |
boolean |
isEquivalentNode(Node node) |
boolean |
isInTree()
Determines if the node is any tree
|
boolean |
isSameNode(Node a) |
boolean |
isSupported(String feature,
String version) |
static String |
lookupNamespace(Node current,
List<Node> ancestors) |
static String |
lookupNamespace(String prefix,
List<Node> path) |
String |
lookupNamespaceURI(String prefix) |
String |
lookupPrefix(String uri) |
static String |
lookupPrefix(String uri,
List<Node> path) |
void |
normalize() |
Node |
removeChild(Node node)
Removes the node from children list.
|
Node |
reorderChild(Node child,
int index)
Moves child node to new position.
|
void |
reorderChildren(int[] permutation)
Rearranges children list to the given permutaion.
|
Node |
replaceChild(Node newNode,
Node oldNode)
Repalces the node oldNode with newNode.
|
void |
setNodeValue(String str) |
void |
setPrefix(String str) |
void |
setTextContent(String a) |
Object |
setUserData(String a,
Object b,
UserDataHandler c) |
String |
toString() |
public static final String XMLNS
public final int getId()
public final boolean isInTree()
Node.addedToTree(XDMModel)
public void addedToTree(XDMModel model)
public void assignNodeIdRecursively()
public void assignNodeId(int id)
protected XDMModel getModel()
public boolean isEquivalentNode(Node node)
node
- Node to comparepublic boolean isSupported(String feature, String version)
isSupported
in interface Node
public Node clone(boolean cloneContent, boolean cloneAttributes, boolean cloneChildren)
cloneContent
- If true the content of clone can be modified.cloneAttributes
- If true the attributes of the clone can be modified.cloneChildren
- If true the children of the clone can be modified.public Node cloneNode(boolean deep)
public Node cloneNode(boolean deep, boolean cloneNamespacePrefix)
public Node cloneNode(boolean deep, Map<Integer,String> allNS, Map<String,String> clonePrefixes)
protected void cloneNamespacePrefixes(Map<Integer,String> allNS, Map<String,String> prefixes)
public Node cloneShallowWithModelContext()
public boolean hasChildNodes()
hasChildNodes
in interface Node
public NodeList getChildNodes()
getChildNodes
in interface Node
public Node getFirstChild()
getFirstChild
in interface Node
public Node getLastChild()
getLastChild
in interface Node
public int getIndexOfChild(Node n)
Node
public Node appendChild(Node node)
appendChild
in interface Node
node
- - The node to add.public Node replaceChild(Node newNode, Node oldNode)
replaceChild
in interface Node
newNode
- - The new node to put in the child list.oldNode
- - The node being replaced in the list.public Node reorderChild(Node child, int index)
child
- - The node being reordered in the list.public void reorderChildren(int[] permutation)
permutation
- integer array with index represents current index and
value is final index after reordered.public Node removeChild(Node node)
removeChild
in interface Node
node
- - The node being removed from the list.public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore
in interface Node
newChild
- - The node to insert.refChild
- - The reference node, i.e., the node before which the new node must be inserted.DOMException
public boolean hasAttributes()
hasAttributes
in interface Node
public NamedNodeMap getAttributes()
getAttributes
in interface Node
public Document getOwnerDocument()
getOwnerDocument
in interface Node
public Node getParentNode()
getParentNode
in interface Node
public Node getNextSibling()
getNextSibling
in interface Node
public Node getPreviousSibling()
getPreviousSibling
in interface Node
public abstract short getNodeType()
getNodeType
in interface Node
public abstract String getNodeName()
getNodeName
in interface Node
public String getNodeValue() throws DOMException
getNodeValue
in interface Node
DOMException
public void setNodeValue(String str) throws DOMException
setNodeValue
in interface Node
DOMException
public String getLocalName()
getLocalName
in interface Node
public String getNamespaceURI(Document document)
Node
public String getNamespaceURI()
getNamespaceURI
in interface Node
public String lookupNamespaceURI(String prefix)
lookupNamespaceURI
in interface Node
public String lookupPrefix(String uri)
lookupPrefix
in interface Node
public void setPrefix(String str) throws DOMException
setPrefix
in interface Node
DOMException
public short compareDocumentPosition(Node a)
compareDocumentPosition
in interface Node
public String getBaseURI()
getBaseURI
in interface Node
public Object getFeature(String a, String b)
getFeature
in interface Node
public String getTextContent()
getTextContent
in interface Node
public Object getUserData(String a)
getUserData
in interface Node
public boolean isDefaultNamespace(String a)
isDefaultNamespace
in interface Node
public boolean isEqualNode(Node a)
isEqualNode
in interface Node
public boolean isSameNode(Node a)
isSameNode
in interface Node
public void setTextContent(String a)
setTextContent
in interface Node
public Object setUserData(String a, Object b, UserDataHandler c)
setUserData
in interface Node
public void copyTokens(Node newNode)
protected List<Attribute> getAttributesForRead()
protected List<Attribute> getAttributesForWrite()
public List<Token> getTokens()
public Node copy()