public class ComplexNodePattern<M,K> extends NodePattern<M>
Modifier and Type | Class and Description |
---|---|
static class |
ComplexNodePattern.AbstractStringAnnotationPattern |
static class |
ComplexNodePattern.AttributesEqualMatchChecker<K> |
static class |
ComplexNodePattern.IntegerAnnotationPattern |
static class |
ComplexNodePattern.NilAnnotationPattern |
static class |
ComplexNodePattern.NotNilAnnotationPattern |
static class |
ComplexNodePattern.NumericAnnotationPattern |
static class |
ComplexNodePattern.SequenceRegexPattern<T> |
static class |
ComplexNodePattern.StringAnnotationPattern |
static class |
ComplexNodePattern.StringAnnotationRegexPattern |
static class |
ComplexNodePattern.StringInSetAnnotationPattern |
NodePattern.AnyNodePattern<T>, NodePattern.ConjNodePattern<T>, NodePattern.DisjNodePattern<T>, NodePattern.EqualsNodePattern<T>, NodePattern.NegateNodePattern<T>
ANY_NODE, CASE_INSENSITIVE, NORMALIZE, UNICODE_CASE
Constructor and Description |
---|
ComplexNodePattern(java.util.function.BiFunction<M,K,java.lang.Object> getter,
K key,
NodePattern pattern) |
ComplexNodePattern(java.util.function.BiFunction<M,K,java.lang.Object> getter,
java.util.List<Pair<K,NodePattern>> annotationPatterns) |
ComplexNodePattern(java.util.function.BiFunction<M,K,java.lang.Object> getter,
Pair<K,NodePattern>... annotationPatterns) |
Modifier and Type | Method and Description |
---|---|
void |
add(K c,
NodePattern pattern) |
java.util.List<Pair<K,NodePattern>> |
getAnnotationPatterns() |
boolean |
match(M token)
Returns true if the input node matches this pattern
|
protected boolean |
match(M token,
java.util.Map<K,java.lang.Object> matchResults) |
java.lang.Object |
matchWithResult(M token)
Returns result associated with the match
|
static NodePattern<java.lang.String> |
newStringRegexPattern(java.lang.String regex,
int flags) |
protected void |
populate(Env env,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.util.function.Function<Pair<Env,java.lang.String>,K> getKey) |
java.lang.String |
toString() |
static <M,K> ComplexNodePattern |
valueOf(Env env,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.util.function.BiFunction<M,K,java.lang.Object> getter,
java.util.function.Function<Pair<Env,java.lang.String>,K> getKey) |
public ComplexNodePattern(java.util.function.BiFunction<M,K,java.lang.Object> getter, java.util.List<Pair<K,NodePattern>> annotationPatterns)
public ComplexNodePattern(java.util.function.BiFunction<M,K,java.lang.Object> getter, Pair<K,NodePattern>... annotationPatterns)
public ComplexNodePattern(java.util.function.BiFunction<M,K,java.lang.Object> getter, K key, NodePattern pattern)
public java.util.List<Pair<K,NodePattern>> getAnnotationPatterns()
public static NodePattern<java.lang.String> newStringRegexPattern(java.lang.String regex, int flags)
public static <M,K> ComplexNodePattern valueOf(Env env, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.function.BiFunction<M,K,java.lang.Object> getter, java.util.function.Function<Pair<Env,java.lang.String>,K> getKey)
protected void populate(Env env, java.util.Map<java.lang.String,java.lang.String> attributes, java.util.function.Function<Pair<Env,java.lang.String>,K> getKey)
public void add(K c, NodePattern pattern)
public boolean match(M token)
NodePattern
match
in class NodePattern<M>
token
- - node to matchpublic java.lang.Object matchWithResult(M token)
NodePattern
matchWithResult
in class NodePattern<M>
token
- node to matchpublic java.lang.String toString()
toString
in class java.lang.Object