Class TernaryExpression

java.lang.Object
io.micronaut.expressions.parser.ast.ExpressionNode
io.micronaut.expressions.parser.ast.conditional.TernaryExpression
Direct Known Subclasses:
ElvisOperator

@Internal public class TernaryExpression extends ExpressionNode
Expression AST node for ternary expressions.
Since:
4.0.0
Author:
Sergey Gavrilov
  • Constructor Details

  • Method Details

    • 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 class ExpressionNode
      Parameters:
      ctx - expression compilation context
      Returns:
      The expression definition
    • shouldCoerceConditionToBoolean

      protected boolean shouldCoerceConditionToBoolean()
      Returns:
      Whether the condition should be coerced to a boolean type.
    • 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 class ExpressionNode
      Parameters:
      ctx - expression compilation context
      Returns:
      resolved type