Package org.xmlunit.diff
Interface ElementSelectors.ConditionalSelectorBuilder
-
- Enclosing class:
- ElementSelectors
public static interface ElementSelectors.ConditionalSelectorBuilderAllows to build complexElementSelectors by combining simpler blocks.All
when*s are consulted in order and if one returnstruethen the associatedElementSelectoris used. If all of the, returnfalse, the default set up withelseUseif any is used.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ElementSelectorbuild()Builds a conditional ElementSelector.ElementSelectors.ConditionalSelectorBuilderelseUse(ElementSelector es)Assigns a default ElementSelector that is used if allwhens have returned false.ElementSelectors.ConditionalSelectorBuilderThenwhen(Predicate<? super Element> predicate)Sets up a conditional ElementSelector.ElementSelectors.ConditionalSelectorBuilderThenwhenElementIsNamed(String expectedName)Sets up a conditional ElementSelector.ElementSelectors.ConditionalSelectorBuilderThenwhenElementIsNamed(QName expectedName)Sets up a conditional ElementSelector.
-
-
-
Method Detail
-
when
ElementSelectors.ConditionalSelectorBuilderThen when(Predicate<? super Element> predicate)
Sets up a conditional ElementSelector.- Parameters:
predicate- the condition that must hold true- Returns:
- a then-part setting up the ElementSelector to use
-
whenElementIsNamed
ElementSelectors.ConditionalSelectorBuilderThen whenElementIsNamed(String expectedName)
Sets up a conditional ElementSelector.- Parameters:
expectedName- expected name of the control element- Returns:
- a then-part setting up the ElementSelector to use
-
whenElementIsNamed
ElementSelectors.ConditionalSelectorBuilderThen whenElementIsNamed(QName expectedName)
Sets up a conditional ElementSelector.- Parameters:
expectedName- expected name of the control element- Returns:
- a then-part setting up the ElementSelector to use
-
elseUse
ElementSelectors.ConditionalSelectorBuilder elseUse(ElementSelector es)
Assigns a default ElementSelector that is used if allwhens have returned false.- Parameters:
es- the default ElementSelector to fall back to- Returns:
- the builder
-
build
ElementSelector build()
Builds a conditional ElementSelector.- Returns:
- an ElementSelector adhering to the ocnfigured conditions.
-
-