Class RelationalOperator
java.lang.Object
io.micronaut.expressions.parser.ast.ExpressionNode
io.micronaut.expressions.parser.ast.operator.binary.RelationalOperator
Abstract expression AST node for relational operations. Relational operations can
be applied to numeric types or types that are
Comparable
to each other. It
is unclear at AST building stage what kind of relational operation will be performed, so
this node does not directly include bytecode generation logic. At type resolution stage it
instantiates either NumericComparisonOperation
or ComparablesComparisonOperation
and delegates bytecode generation to respective node instance.- Since:
- 4.0.0
- Author:
- Sergey Gavrilov
-
Field Summary
Fields inherited from class io.micronaut.expressions.parser.ast.ExpressionNode
classElement, nodeType
-
Constructor Summary
ConstructorDescriptionRelationalOperator
(ExpressionNode leftOperand, ExpressionNode rightOperand, io.micronaut.sourcegen.model.ExpressionDef.ComparisonOperation.OpType type) -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micronaut.sourcegen.model.TypeDef
Resolves expression AST node type.io.micronaut.sourcegen.model.ExpressionDef
Generates bytecode for this AST node.Methods inherited from class io.micronaut.expressions.parser.ast.ExpressionNode
compile, doResolveClassElement, doResolveClassElement, resolveClassElement, resolveClassElement, resolveType, resolveType
-
Constructor Details
-
RelationalOperator
public RelationalOperator(ExpressionNode leftOperand, ExpressionNode rightOperand, io.micronaut.sourcegen.model.ExpressionDef.ComparisonOperation.OpType type)
-
-
Method Details
-
doResolveType
protected io.micronaut.sourcegen.model.TypeDef doResolveType(@NonNull @NonNull ExpressionVisitorContext ctx) Description copied from class:ExpressionNode
Resolves expression AST node type.- Overrides:
doResolveType
in classExpressionNode
- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-
generateExpression
public io.micronaut.sourcegen.model.ExpressionDef generateExpression(ExpressionCompilationContext ctx) Description copied from class:ExpressionNode
Generates bytecode for this AST node.- Specified by:
generateExpression
in classExpressionNode
- Parameters:
ctx
- expression compilation context- Returns:
- The expression definition
-