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

@Internal public abstract class ExpressionNode extends Object
Abstract evaluated expression AST node.
Since:
4.0.0
Author:
Sergey Gavrilov
  • Field Details

    • nodeType

      protected org.objectweb.asm.Type nodeType
    • classElement

      protected ClassElement classElement
  • Constructor Details

    • ExpressionNode

      public ExpressionNode()
  • Method Details

    • compile

      public final void 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
    • generateBytecode

      protected abstract void generateBytecode(@NonNull @NonNull ExpressionCompilationContext ctx)
      Generates bytecode for this AST node.
      Parameters:
      ctx - expression compilation context
    • resolveType

      @NonNull public final @NonNull org.objectweb.asm.Type 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 org.objectweb.asm.Type 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

      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

      protected ClassElement doResolveClassElement(ExpressionVisitorContext ctx)
      Resolves the class element for this node.
      Parameters:
      ctx - The expression compilation context
      Returns:
      The resolved type
    • doResolveClassElement

      protected ClassElement doResolveClassElement(ExpressionCompilationContext ctx)
      Resolves the class element for this node.
      Parameters:
      ctx - The expression compilation context
      Returns:
      The resolved type
    • doResolveType

      @NonNull protected abstract @NonNull org.objectweb.asm.Type doResolveType(@NonNull @NonNull ExpressionVisitorContext ctx)
      Resolves expression AST node type.
      Parameters:
      ctx - expression compilation context
      Returns:
      resolved type