Package org.custommonkey.xmlunit
Class ElementNameAndAttributeQualifier
java.lang.Object
org.custommonkey.xmlunit.ElementNameQualifier
org.custommonkey.xmlunit.ElementNameAndAttributeQualifier
- All Implemented Interfaces:
ElementQualifier
More complex interface implementation that tests two elements for tag name
and attribute name comparability.
-
Constructor Summary
ConstructorDescriptionNo-args constructor: use all attributes from all elements to determine whether elements qualify for comparabilityElementNameAndAttributeQualifier
(String attrName) Simple constructor for a single qualifying attribute nameElementNameAndAttributeQualifier
(String[] attrNames) Extended constructor for multiple qualifying attribute names -
Method Summary
Modifier and TypeMethodDescriptionprotected final boolean
areAttributesComparable
(Element control, Element test) Deprecated.this method is no longer used by this class and is only kept for backwards compatibility, overriding it won't have any effect anymoreboolean
qualifyForComparison
(Element control, Element test) Determine whether two elements qualify for further Difference comparison.Methods inherited from class org.custommonkey.xmlunit.ElementNameQualifier
equalsNamespace, getNonNamespacedNodeName
-
Constructor Details
-
ElementNameAndAttributeQualifier
public ElementNameAndAttributeQualifier()No-args constructor: use all attributes from all elements to determine whether elements qualify for comparability -
ElementNameAndAttributeQualifier
Simple constructor for a single qualifying attribute name- Parameters:
attrName
- the value to use to qualify whether two elements can be compared further for differences
-
ElementNameAndAttributeQualifier
Extended constructor for multiple qualifying attribute names- Parameters:
attrNames
- the array of values to use to qualify whether two elements can be compared further for differences
-
-
Method Details
-
qualifyForComparison
Determine whether two elements qualify for further Difference comparison.- Specified by:
qualifyForComparison
in interfaceElementQualifier
- Overrides:
qualifyForComparison
in classElementNameQualifier
- Parameters:
control
- an Element from the control XML NodeListtest
- an Element from the test XML NodeList- Returns:
- true if the two elements qualify for further comparison based on both the superclass qualification (namespace URI and non- namespaced tag name), and the presence of qualifying attributes with the same values; false otherwise
-
areAttributesComparable
Deprecated.this method is no longer used by this class and is only kept for backwards compatibility, overriding it won't have any effect anymoreDetermine whether the qualifying attributes are present in both elements and if so whether their values are the same- Parameters:
control
- control elementtest
- test element- Returns:
- true if all qualifying attributes are present with the same values, false otherwise
-