All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nlab.xml.stream.predicate.Predicates Maven / Gradle / Ivy

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy