public class MultiLevelElementNameAndTextQualifier extends Object implements ElementQualifier
This means ElementNameQualifier
and MultiLevelElementNameQualifier(1) should
lead to the same results.
Any attribute values are completely ignored. Only works on elements with exactly one child element at each level.
This class mostly exists as an example for custom ElementQualifiers.
Constructor and Description |
---|
MultiLevelElementNameAndTextQualifier(int levels)
Uses element names and the text nested
levels
child elements deeper into the element to compare elements. |
MultiLevelElementNameAndTextQualifier(int levels,
boolean ignoreEmptyTexts)
Uses element names and the text nested
levels
child elements deeper into the element to compare elements. |
Modifier and Type | Method and Description |
---|---|
boolean |
qualifyForComparison(Element control,
Element test)
Determine whether two elements are comparable
|
public MultiLevelElementNameAndTextQualifier(int levels)
levels
child elements deeper into the element to compare elements.
Does not ignore empty text nodes.
public MultiLevelElementNameAndTextQualifier(int levels, boolean ignoreEmptyTexts)
levels
child elements deeper into the element to compare elements.ignoreEmptyTexts
- whether whitespace-only textnodes
should be ignored.public boolean qualifyForComparison(Element control, Element test)
ElementQualifier
qualifyForComparison
in interface ElementQualifier
control
- an Element from the control XML NodeListtest
- an Element from the test XML NodeListCopyright © 2001–2020 XMLUnit. All rights reserved.