@Test public void conditionalBuilder() { Element control = doc.createElement(FOO); Element test = doc.createElement(BAR); ElementSelectors.ConditionalSelectorBuilder builder = ElementSelectors.conditionalBuilder() .whenElementIsNamed(FOO).thenUse(ElementSelectors.byName); assertFalse(builder.build().canBeCompared(control, test)); builder.elseUse(ElementSelectors.Default); assertFalse(builder.build().canBeCompared(control, test)); Element control2 = doc.createElement("baz"); assertTrue(builder.build().canBeCompared(control2, test)); }
public static ConditionalSelectorBuilder conditionalBuilder() { return new DefaultConditionalSelectorBuilder(); }
ElementSelectors { public static ConditionalSelectorBuilder conditionalBuilder() { return new DefaultConditionalSelectorBuilder(); } }
ElementSelectors { public static ConditionalSelectorBuilder conditionalBuilder() { return new DefaultConditionalSelectorBuilder(); } private  ElementSelectors(); }
ElementSelectors { public static ConditionalSelectorBuilder conditionalBuilder() { return new DefaultConditionalSelectorBuilder(); } private  ElementSelectors(); static ElementSelector byNameAndAttributes(String... attribs); static ElementSelector byNameAndAttributesControlNS(final String... attribs); static ElementSelector byNameAndAttributes(final QName... attribs); static ElementSelector not(final ElementSelector es); static ElementSelector or(final ElementSelector... selectors); static ElementSelector and(final ElementSelector... selectors); static ElementSelector xor(final ElementSelector es1,
                                      final ElementSelector es2); static ElementSelector conditionalSelector(final Predicate<? super Element> predicate,
                                                      final ElementSelector es); static ElementSelector selectorForElementNamed(final String expectedName,
                                                          final ElementSelector es); static ElementSelector selectorForElementNamed(final QName expectedName,
                                                          final ElementSelector es); static ElementSelector byXPath(String xpath, ElementSelector childSelector); static ElementSelector byXPath(final String xpath,
                                          Map<String, String> prefix2Uri,
                                          ElementSelector childSelector); static ConditionalSelectorBuilder conditionalBuilder(); }
ElementSelectors { public static ConditionalSelectorBuilder conditionalBuilder() { return new DefaultConditionalSelectorBuilder(); } private  ElementSelectors(); static ElementSelector byNameAndAttributes(String... attribs); static ElementSelector byNameAndAttributesControlNS(final String... attribs); static ElementSelector byNameAndAttributes(final QName... attribs); static ElementSelector not(final ElementSelector es); static ElementSelector or(final ElementSelector... selectors); static ElementSelector and(final ElementSelector... selectors); static ElementSelector xor(final ElementSelector es1,
                                      final ElementSelector es2); static ElementSelector conditionalSelector(final Predicate<? super Element> predicate,
                                                      final ElementSelector es); static ElementSelector selectorForElementNamed(final String expectedName,
                                                          final ElementSelector es); static ElementSelector selectorForElementNamed(final QName expectedName,
                                                          final ElementSelector es); static ElementSelector byXPath(String xpath, ElementSelector childSelector); static ElementSelector byXPath(final String xpath,
                                          Map<String, String> prefix2Uri,
                                          ElementSelector childSelector); static ConditionalSelectorBuilder conditionalBuilder(); static final ElementSelector Default; static final ElementSelector byName; static final ElementSelector byNameAndText; static final ElementSelector byNameAndAllAttributes; }