Package dev.vortex.api
Interface Expression.Visitor<T>
- Type Parameters:
T
- the return type of the visitor methods
- Enclosing interface:
- Expression
public static interface Expression.Visitor<T>
Visitor interface for implementing the visitor pattern on expressions.
This interface defines methods for visiting different types of expressions,
allowing for type-safe operations across the expression hierarchy.
-
Method Summary
Modifier and TypeMethodDescriptionvisitBinary
(Binary binary) Visits a binary expression.visitGetItem
(GetItem getItem) Visits a get item expression (array/object indexing).visitLiteral
(Literal<?> literal) Visits a literal expression.Visits a not expression (logical negation).visitOther
(Expression expression) For expressions that do not have a specific visitor method.Visits a root expression.
-
Method Details
-
visitLiteral
Visits a literal expression.- Parameters:
literal
- the literal expression to visit- Returns:
- the result of visiting the literal expression
-
visitRoot
Visits a root expression.- Parameters:
root
- the root expression to visit- Returns:
- the result of visiting the root expression
-
visitBinary
Visits a binary expression.- Parameters:
binary
- the binary expression to visit- Returns:
- the result of visiting the binary expression
-
visitNot
Visits a not expression (logical negation).- Parameters:
not
- the not expression to visit- Returns:
- the result of visiting the not expression
-
visitGetItem
Visits a get item expression (array/object indexing).- Parameters:
getItem
- the get item expression to visit- Returns:
- the result of visiting the get item expression
-
visitOther
For expressions that do not have a specific visitor method.
-