Class ExpressionNode
java.lang.Object
io.micronaut.expressions.parser.ast.ExpressionNode
- Direct Known Subclasses:
AbstractMethodCall
,BeanContextAccess
,BinaryOperator
,BoolLiteral
,ComparablesComparisonOperation
,ContextElementAccess
,DoubleLiteral
,EnvironmentAccess
,FloatLiteral
,InstanceofOperator
,IntLiteral
,LongLiteral
,MatchesOperator
,NullLiteral
,NumericComparisonOperation
,OneDimensionalArray
,RelationalOperator
,StringLiteral
,SubscriptOperator
,TernaryExpression
,ThisAccess
,TypeIdentifier
,UnaryOperator
Abstract evaluated expression AST node.
- Since:
- 4.0.0
- Author:
- Sergey Gavrilov
-
Field Summary
Modifier and TypeFieldDescriptionprotected ClassElement
protected io.micronaut.sourcegen.model.TypeDef
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal io.micronaut.sourcegen.model.ExpressionDef
Compiles this expression AST node against passes compilation context.protected ClassElement
Resolves the class element for this node.protected ClassElement
Resolves the class element for this node.protected @NonNull io.micronaut.sourcegen.model.TypeDef
Resolves expression AST node type.protected abstract io.micronaut.sourcegen.model.ExpressionDef
Generates bytecode for this AST node.final @NonNull ClassElement
On resolution stage type information is collected and node validity is checked.final @NonNull ClassElement
On resolution stage type information is collected and node validity is checked.final @NonNull io.micronaut.sourcegen.model.TypeDef
On resolution stage type information is collected and node validity is checked.final @NonNull io.micronaut.sourcegen.model.TypeDef
On resolution stage type information is collected and node validity is checked.
-
Field Details
-
nodeType
protected io.micronaut.sourcegen.model.TypeDef nodeType -
classElement
-
-
Constructor Details
-
ExpressionNode
public ExpressionNode()
-
-
Method Details
-
compile
public final io.micronaut.sourcegen.model.ExpressionDef compile(@NonNull @NonNull ExpressionCompilationContext ctx) Compiles this expression AST node against passes compilation context. Node compilation includes type resolution and bytecode generation.- Parameters:
ctx
- expression compilation context- Returns:
- The expression definition
-
generateExpression
protected abstract io.micronaut.sourcegen.model.ExpressionDef generateExpression(@NonNull @NonNull ExpressionCompilationContext ctx) Generates bytecode for this AST node.- Parameters:
ctx
- expression compilation context- Returns:
- The expression definition
-
resolveType
@NonNull public final @NonNull io.micronaut.sourcegen.model.TypeDef resolveType(@NonNull @NonNull ExpressionVisitorContext ctx) On resolution stage type information is collected and node validity is checked. Once type is resolved, type resolution result is cached.- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-
resolveType
@NonNull public final @NonNull io.micronaut.sourcegen.model.TypeDef resolveType(@NonNull @NonNull ExpressionCompilationContext ctx) On resolution stage type information is collected and node validity is checked. Once type is resolved, type resolution result is cached.- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-
resolveClassElement
@NonNull public final @NonNull ClassElement resolveClassElement(@NonNull @NonNull ExpressionVisitorContext ctx) On resolution stage type information is collected and node validity is checked. Once type is resolved, type resolution result is cached.- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-
resolveClassElement
@NonNull public final @NonNull ClassElement resolveClassElement(@NonNull @NonNull ExpressionCompilationContext ctx) On resolution stage type information is collected and node validity is checked. Once type is resolved, type resolution result is cached.- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-
doResolveClassElement
Resolves the class element for this node.- Parameters:
ctx
- The expression compilation context- Returns:
- The resolved type
-
doResolveClassElement
Resolves the class element for this node.- Parameters:
ctx
- The expression compilation context- Returns:
- The resolved type
-
doResolveType
@NonNull protected @NonNull io.micronaut.sourcegen.model.TypeDef doResolveType(@NonNull @NonNull ExpressionVisitorContext ctx) Resolves expression AST node type.- Parameters:
ctx
- expression compilation context- Returns:
- resolved type
-