org.nlab.xml.stream.predicate.Predicates Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xml-stream-css Show documentation
Show all versions of xml-stream-css Show documentation
Stream Xml using StAX and Css matcher
The newest version!
package org.nlab.xml.stream.predicate;
import java.util.function.Predicate;
import org.nlab.xml.stream.context.StreamContext;
import jodd.csselly.CSSelly;
/**
* Created by nlabrot on 15/03/15.
*/
public final class Predicates {
private Predicates() {
}
public static Predicate elements(String... elements) {
return new ElementPredicate(true, false, elements);
}
public static Predicate element(String element) {
return new ElementPredicate(true, false, element);
}
public static Predicate attributes(String... attributes) {
return new AttributePredicate(true, false, attributes);
}
public static Predicate attributeValue(String... attributes) {
return new AttributeValuesPredicate(true, false, attributes);
}
public static Predicate allElements() {
return AllElementPredicate.INSTANCE_START;
}
public static Predicate css(String query) {
return new CssPredicate(CSSelly.parse(query), true, false);
}
public static Predicate all() {
return AllPredicate.INSTANCE;
}
}