@FunctionalInterface
public interface TextPredicate
| Modifier and Type | Field | Description |
|---|---|---|
static TextPredicate |
ANY_TEXT |
|
static TextPredicate |
IGNORABLE_TEXT |
|
static TextPredicate |
NON_IGNORABLE_TEXT |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
accepts(Parent parent,
Text text) |
Returns
true when a text must be kept. |
default TextPredicate |
and(TextPredicate other) |
Returns a predicate that is the logical
and combination of this one and another one. |
static TextPredicate |
fromElementNames(java.util.Collection<java.lang.String> names) |
Returns an TextPredicate that returns true when the text id defined in an element whose name belongs to a collection.
|
static TextPredicate |
fromElementPaths(java.util.Collection<SPath> paths) |
|
default TextPredicate |
not() |
|
default TextPredicate |
or(TextPredicate other) |
Returns a predicate that is the logical
or combination of this one and another one. |
static final TextPredicate ANY_TEXT
static final TextPredicate IGNORABLE_TEXT
static final TextPredicate NON_IGNORABLE_TEXT
boolean accepts(Parent parent, Text text)
true when a text must be kept.
Text (and its parents) must have been created before this can be called.
parent - The text parent.text - The text node.true if text must be kept, false otherwise.default TextPredicate not()
default TextPredicate and(TextPredicate other)
and combination of this one and another one.other - The other predicate.and combination of this one and other.java.lang.IllegalArgumentException - When other is null.default TextPredicate or(TextPredicate other)
or combination of this one and another one.other - The other predicate.or combination of this one and other.java.lang.IllegalArgumentException - When other is null.static TextPredicate fromElementNames(java.util.Collection<java.lang.String> names)
It is advised to use an efficient collection, typically a Set.
names - The collections of names. MUST NOT be null.true when the text is in an element whose name belong to names.java.lang.IllegalArgumentException - When names is null.static TextPredicate fromElementPaths(java.util.Collection<SPath> paths)
Copyright © 2019. All rights reserved.