Package io.dialob.rule.parser
Class AstMatcher
- java.lang.Object
-
- io.dialob.rule.parser.AstMatcher
-
- All Implemented Interfaces:
ASTVisitor
- Direct Known Subclasses:
ConvertDateMinusDateVisitor,EvalNotExpressionsVisitor,ModifyingMinifierVisitor,ValidateExpressionVisitor
public class AstMatcher extends Object implements ASTVisitor
-
-
Constructor Summary
Constructors Constructor Description AstMatcher()
-
Method Summary
-
-
-
Method Detail
-
whenMatches
public void whenMatches(Predicate<NodeBase> matcher, UnaryOperator<NodeBase> thenAction)
-
visitCallExpr
public ASTVisitor visitCallExpr(@NotNull @NotNull CallExprNode node)
- Specified by:
visitCallExprin interfaceASTVisitor
-
endCallExpr
@NotNull public @NotNull NodeBase endCallExpr(@NotNull @NotNull CallExprNode node)
- Specified by:
endCallExprin interfaceASTVisitor
-
checkIsThisLast
protected void checkIsThisLast(NodeBase nodeBase)
-
visitConstExpr
@NotNull public @NotNull NodeBase visitConstExpr(@NotNull @NotNull ConstExprNode node)
- Specified by:
visitConstExprin interfaceASTVisitor
-
visitIdExpr
@NotNull public @NotNull NodeBase visitIdExpr(@NotNull @NotNull IdExprNode node)
- Specified by:
visitIdExprin interfaceASTVisitor
-
checkMatchingBefore
protected void checkMatchingBefore(NodeBase node)
-
isNull
public static <T> Predicate<T> isNull()
-
is
public static <T> Predicate<T> is(@NotNull T equalsTo)
-
dependencies
public static Predicate<NodeBase> dependencies(Predicate<Map<String,ValueType>> predicate)
-
size
public static <T> Predicate<Collection<T>> size(Predicate<Integer> predicate)
-
values
public static <K,V> Predicate<Map<K,V>> values(Predicate<Collection<V>> predicate)
-
contains
public static <T> Predicate<Collection<T>> contains(Predicate<T> predicate)
-
contains
public static <T> Predicate<Collection<T>> contains(T t)
-
operCategory
public static Predicate<NodeBase> operCategory(Predicate<NodeOperator.Category> predicate)
-
callNode
public static Predicate<NodeBase> callNode(@NotNull @NotNull Predicate<NodeBase> predicate)
-
any
public static <T> Predicate<T> any()
-
constNode
public static Predicate<NodeBase> constNode(@NotNull @NotNull Predicate<NodeBase> predicate)
-
newASTBuilder
public ASTBuilder newASTBuilder()
-
-