Package org.custommonkey.xmlunit
Class ElementNameAndAttributeQualifier
- java.lang.Object
-
- org.custommonkey.xmlunit.ElementNameQualifier
-
- org.custommonkey.xmlunit.ElementNameAndAttributeQualifier
-
- All Implemented Interfaces:
ElementQualifier
public class ElementNameAndAttributeQualifier extends ElementNameQualifier
More complex interface implementation that tests two elements for tag name and attribute name comparability.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
ALL_ATTRIBUTES
private java.lang.String[]
qualifyingAttrNames
private ElementSelector
selector
-
Constructor Summary
Constructors Constructor Description ElementNameAndAttributeQualifier()
No-args constructor: use all attributes from all elements to determine whether elements qualify for comparabilityElementNameAndAttributeQualifier(java.lang.String attrName)
Simple constructor for a single qualifying attribute nameElementNameAndAttributeQualifier(java.lang.String[] attrNames)
Extended constructor for multiple qualifying attribute names
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
areAttributesComparable(org.w3c.dom.Element control, org.w3c.dom.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 anymoreprivate static boolean
matchesAllAttributes(java.lang.String[] attributes)
boolean
qualifyForComparison(org.w3c.dom.Element control, org.w3c.dom.Element test)
Determine whether two elements qualify for further Difference comparison.-
Methods inherited from class org.custommonkey.xmlunit.ElementNameQualifier
equalsNamespace, getNonNamespacedNodeName
-
-
-
-
Field Detail
-
selector
private final ElementSelector selector
-
ALL_ATTRIBUTES
private static final java.lang.String[] ALL_ATTRIBUTES
-
qualifyingAttrNames
private final java.lang.String[] qualifyingAttrNames
-
-
Constructor Detail
-
ElementNameAndAttributeQualifier
public ElementNameAndAttributeQualifier()
No-args constructor: use all attributes from all elements to determine whether elements qualify for comparability
-
ElementNameAndAttributeQualifier
public ElementNameAndAttributeQualifier(java.lang.String attrName)
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
public ElementNameAndAttributeQualifier(java.lang.String[] attrNames)
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 Detail
-
qualifyForComparison
public boolean qualifyForComparison(org.w3c.dom.Element control, org.w3c.dom.Element test)
Determine whether two elements qualify for further Difference comparison.- Specified by:
qualifyForComparison
in interfaceElementQualifier
- Overrides:
qualifyForComparison
in classElementNameQualifier
- Parameters:
control
-test
-- 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 protected final boolean areAttributesComparable(org.w3c.dom.Element control, org.w3c.dom.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 anymoreDetermine whether the qualifying attributes are present in both elements and if so whether their values are the same- Parameters:
control
-test
-- Returns:
- true if all qualifying attributes are present with the same values, false otherwise
-
matchesAllAttributes
private static boolean matchesAllAttributes(java.lang.String[] attributes)
-
-