private boolean isNodeInNodeList(Node node, NodeList nodeList){ int length = nodeList.getLength(); for (int x = 0; x < length; x++) { Node nextNode = nodeList.item(x); if(isNodeEqual(node, nextNode)){ return true; } } return false; }
private boolean isNodeInNodeList(Node node, NodeList nodeList){ int length = nodeList.getLength(); for (int x = 0; x < length; x++) { Node nextNode = nodeList.item(x); if(isNodeEqual(node, nextNode)){ return true; } } return false; }
private boolean isNodeInNodeList(Node node, NodeList nodeList){ int length = nodeList.getLength(); for (int x = 0; x < length; x++) { Node nextNode = nodeList.item(x); if(isNodeEqual(node, nextNode)){ return true; } } return false; }
private boolean isNodeListEqual(NodeList control, NodeList test) { int numberOfControlNodes = control.getLength(); if (numberOfControlNodes != test.getLength()) { return false; } if(ignoreOrder){ for (int x = 0; x < numberOfControlNodes; x++) { if(!isNodeInNodeList(control.item(x), test)){ return false; } } for (int x = 0; x < numberOfControlNodes; x++) { if(!isNodeInNodeList(test.item(x), control)){ return false; } } }else{ for (int x = 0; x < numberOfControlNodes; x++) { if (!isNodeEqual(control.item(x), test.item(x))) { return false; } } } return true; }
private boolean isNodeListEqual(NodeList control, NodeList test) { int numberOfControlNodes = control.getLength(); if (numberOfControlNodes != test.getLength()) { return false; } if(ignoreOrder){ for (int x = 0; x < numberOfControlNodes; x++) { if(!isNodeInNodeList(control.item(x), test)){ return false; } } for (int x = 0; x < numberOfControlNodes; x++) { if(!isNodeInNodeList(test.item(x), control)){ return false; } } }else{ for (int x = 0; x < numberOfControlNodes; x++) { if (!isNodeEqual(control.item(x), test.item(x))) { return false; } } } return true; }
private boolean isNodeListEqual(NodeList control, NodeList test) { int numberOfControlNodes = control.getLength(); if (numberOfControlNodes != test.getLength()) { return false; } if(ignoreOrder){ for (int x = 0; x < numberOfControlNodes; x++) { if(!isNodeInNodeList(control.item(x), test)){ return false; } } for (int x = 0; x < numberOfControlNodes; x++) { if(!isNodeInNodeList(test.item(x), control)){ return false; } } }else{ for (int x = 0; x < numberOfControlNodes; x++) { if (!isNodeEqual(control.item(x), test.item(x))) { return false; } } } return true; }
/** * INTERNAL: * Compare the attribute values. * Compare Nodes if mapped as a DOM. */ @Override protected boolean compareObjectValues(Object firstValue, Object secondValue, AbstractSession session) { // PERF: Check identity before conversion. if (firstValue == secondValue) { return true; } if ((firstValue == null) || (secondValue == null)) { return false; } if (getAttributeClassification() == ClassConstants.STRING) { return firstValue.equals(secondValue); } else { Object one = getFieldValue(firstValue, session); Object two = getFieldValue(secondValue, session); if (one instanceof Node && two instanceof Node) { return this.xmlComparer.isNodeEqual((Node)one, (Node)two); } return one.equals(two); } } }
/** * INTERNAL: * Compare the attribute values. * Compare Nodes if mapped as a DOM. */ @Override protected boolean compareObjectValues(Object firstValue, Object secondValue, AbstractSession session) { // PERF: Check identity before conversion. if (firstValue == secondValue) { return true; } if ((firstValue == null) && (secondValue == null)) { return true; } if ((firstValue == null) || (secondValue == null)) { return false; } if (getAttributeClassification() == ClassConstants.STRING) { return firstValue.equals(secondValue); } else { Object one = getFieldValue(firstValue, session); Object two = getFieldValue(secondValue, session); if (one instanceof Node && two instanceof Node) { return this.xmlComparer.isNodeEqual((Node)one, (Node)two); } return one.equals(two); } } }
/** * INTERNAL: * Compare the attribute values. * Compare Nodes if mapped as a DOM. */ @Override protected boolean compareObjectValues(Object firstValue, Object secondValue, AbstractSession session) { // PERF: Check identity before conversion. if (firstValue == secondValue) { return true; } if ((firstValue == null) && (secondValue == null)) { return true; } if ((firstValue == null) || (secondValue == null)) { return false; } if (getAttributeClassification() == ClassConstants.STRING) { return firstValue.equals(secondValue); } else { Object one = getFieldValue(firstValue, session); Object two = getFieldValue(secondValue, session); if (one instanceof Node && two instanceof Node) { return this.xmlComparer.isNodeEqual((Node)one, (Node)two); } return one.equals(two); } } }