Package org.custommonkey.xmlunit
Class ElementNameAndTextQualifier
java.lang.Object
org.custommonkey.xmlunit.ElementNameQualifier
org.custommonkey.xmlunit.ElementNameAndTextQualifier
- All Implemented Interfaces:
ElementQualifier
More complex interface implementation that tests two elements for tag name
and text content comparability.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Text
extractText
(Element fromElement) Extract the normalized text from within an elementboolean
qualifyForComparison
(Element control, Element test) Determine whether two elements qualify for further Difference comparison.protected boolean
Determine whether the text nodes contain similar valuesMethods inherited from class org.custommonkey.xmlunit.ElementNameQualifier
equalsNamespace, getNonNamespacedNodeName
-
Constructor Details
-
ElementNameAndTextQualifier
public ElementNameAndTextQualifier()
-
-
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 qualification of the text nodes contained within the elements; false otherwise
-
similar
Determine whether the text nodes contain similar values- Parameters:
control
- control texttest
- test text- Returns:
- true if text nodes are similar, false otherwise
-
extractText
Extract the normalized text from within an element- Parameters:
fromElement
- element to extract text from- Returns:
- extracted Text node (could be null)
-