Class PluginUtil
java.lang.Object
org.somda.sdc.biceps.model.plugins.PluginUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancustomIsEqualNode(Node left, Node right) The code is based on the isEqualNode methods of the classescom.sun.org.apache.xerces.internal.dom.NodeImpl,com.sun.org.apache.xerces.internal.dom.ParentNodeandcom.sun.org.apache.xerces.internal.dom.ElementImpl, but it will not consider the namespace prefix when comparing two nodes.
-
Constructor Details
-
PluginUtil
public PluginUtil()
-
-
Method Details
-
customIsEqualNode
The code is based on the isEqualNode methods of the classescom.sun.org.apache.xerces.internal.dom.NodeImpl,com.sun.org.apache.xerces.internal.dom.ParentNodeandcom.sun.org.apache.xerces.internal.dom.ElementImpl, but it will not consider the namespace prefix when comparing two nodes.Tests whether two nodes are equal.
This method tests for equality of nodes, not sameness (i.e., whether the two nodes are references to the same object) which can be tested withNode.isSameNode(). All nodes that are the same will also be equal, though the reverse may not be true.
Two nodes are equal if and only if the following conditions are satisfied:- The two nodes are of the same type.
- The following string attributes are equal:
localName,namespaceURI,nodeValue. This is: they are bothnull, or they have the same length and are character for character identical. - The
attributesNamedNodeMapsare equal. This is: they are bothnull, or they have the same length and for each node that exists in one map there is a node that exists in the other map with the samenodeValueandnamespaceURI, although not necessarily at the same index. - The
childNodesNodeListsare equal. This is: they are bothnull, or they have the same length and contain equal nodes at the same index. Note that normalization can affect equality; to avoid this, nodes should be normalized before being compared.
On the other hand, the following do not affect equality: theownerDocument,baseURI, andparentNodeattributes, thespecifiedattribute forAttrnodes, theschemaTypeInfoattribute forAttrandElementnodes, theText.isElementContentWhitespaceattribute forTextnodes, as well as any user data or event listeners registered on the nodes.Note: As a general rule, anything not mentioned in the description above is not significant in consideration of equality checking.
- Parameters:
left- node to compare equality with.right- node to compare equality with.- Returns:
- Returns
trueif the nodes are equal,falseotherwise.
-