@Test(expected = IllegalArgumentException.class) public void conditionalSelectorDoesntLikeNullElementSelector() { ElementSelectors.conditionalSelector(new IsNullPredicate(), null); }
public static ElementSelector conditionalSelector(final Predicate<? super Element> predicate, final ElementSelector es) { if (predicate == null) { throw new IllegalArgumentException("predicate must not be null"); } if (es == null) { throw new IllegalArgumentException("es must not be null"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return predicate.test(controlElement) && es.canBeCompared(controlElement, testElement); } }; }
ElementSelectors { public static ElementSelector conditionalSelector(final Predicate<? super Element> predicate, final ElementSelector es) { if (predicate == null) { throw new IllegalArgumentException("predicate must not be null"); } if (es == null) { throw new IllegalArgumentException("es must not be null"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return predicate.test(controlElement) && es.canBeCompared(controlElement, testElement); } }; } }
ElementSelectors { public static ElementSelector conditionalSelector(final Predicate<? super Element> predicate, final ElementSelector es) { if (predicate == null) { throw new IllegalArgumentException("predicate must not be null"); } if (es == null) { throw new IllegalArgumentException("es must not be null"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return predicate.test(controlElement) && es.canBeCompared(controlElement, testElement); } }; } private  ElementSelectors(); }
ElementSelectors { public static ElementSelector conditionalSelector(final Predicate<? super Element> predicate, final ElementSelector es) { if (predicate == null) { throw new IllegalArgumentException("predicate must not be null"); } if (es == null) { throw new IllegalArgumentException("es must not be null"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return predicate.test(controlElement) && es.canBeCompared(controlElement, testElement); } }; } 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 ElementSelector conditionalSelector(final Predicate<? super Element> predicate, final ElementSelector es) { if (predicate == null) { throw new IllegalArgumentException("predicate must not be null"); } if (es == null) { throw new IllegalArgumentException("es must not be null"); } return new ElementSelector() { @Override public boolean canBeCompared(Element controlElement, Element testElement) { return predicate.test(controlElement) && es.canBeCompared(controlElement, testElement); } }; } 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; }