Interface ExpressionDef

All Known Subinterfaces:
VariableDef
All Known Implementing Classes:
ExpressionDef.CallInstanceMethod, ExpressionDef.CallStaticMethod, ExpressionDef.Constant, ExpressionDef.Convert, ExpressionDef.NewInstance, VariableDef.Field, VariableDef.Local, VariableDef.MethodParameter, VariableDef.StaticField, VariableDef.This

The expression definition.
Since:
1.0
Author:
Denis Stepanov
  • Method Details

    • constant

      @Nullable static @Nullable ExpressionDef constant(io.micronaut.inject.ast.ClassElement type, TypeDef typeDef, @Nullable @Nullable String stringValue)
      Resolve a constant for the given type from the string.
      Parameters:
      type - The type
      typeDef - The type def
      stringValue - The string value
      Returns:
      The constant
      Throws:
      IllegalArgumentException - if the constant is not supported.
    • type

      TypeDef type()
      The type of the expression.
      Returns:
      The type
    • instantiate

      static ExpressionDef.NewInstance instantiate(ClassTypeDef type, List<ExpressionDef> values)
      The new instance expression.
      Parameters:
      type - The type
      values - The constructor values
      Returns:
      The new instance
    • invoke

      static ExpressionDef.CallInstanceMethod invoke(VariableDef instance, String name, List<ExpressionDef> parameters, TypeDef returning)
      The call the instance method expression.
      Parameters:
      instance - The instance
      name - The method name
      parameters - The parameters
      returning - The returning
      Returns:
      The call to the instance method
    • invokeStatic

      static ExpressionDef.CallStaticMethod invokeStatic(ClassTypeDef typeDef, String name, List<ExpressionDef> parameters, TypeDef returning)
      The call the instance method expression.
      Parameters:
      typeDef - The class type def
      name - The method name
      parameters - The parameters
      returning - The returning
      Returns:
      The call to the static method