Interface ClassTypeDef

All Superinterfaces:
TypeDef
All Known Implementing Classes:
ClassTypeDef.ClassDefType, ClassTypeDef.ClassElementType, ClassTypeDef.ClassName, ClassTypeDef.JavaClass, ClassTypeDef.Parameterized

The class type definition. Not-null by default.
Since:
1.0
Author:
Denis Stepanov
  • Field Details

  • Method Details

    • getName

      String getName()
      Returns:
      The type name
    • getCanonicalName

      default String getCanonicalName()
      Returns:
      The canonical type name
      Since:
      1.5
    • getSimpleName

      default String getSimpleName()
      Returns:
      The simple name
    • getPackageName

      default String getPackageName()
      Returns:
      The package name
    • makeNullable

      ClassTypeDef makeNullable()
      Specified by:
      makeNullable in interface TypeDef
      Returns:
      A new nullable type
    • isEnum

      default boolean isEnum()
      Returns:
      True if the class is an enum
      Since:
      1.2
    • isInterface

      default boolean isInterface()
      Returns:
      True if interface
      Since:
      1.5
    • isInner

      default boolean isInner()
      Returns:
      True if inner
      Since:
      1.5
    • instantiate

      default ExpressionDef.NewInstance instantiate(ExpressionDef... values)
      The new instance expression.
      Parameters:
      values - The constructor values
      Returns:
      The new instance
    • instantiate

      default ExpressionDef.NewInstance instantiate(List<? extends ExpressionDef> values)
      The new instance expression.
      Parameters:
      values - The constructor values
      Returns:
      The new instance
    • instantiate

      default ExpressionDef.NewInstance instantiate(List<TypeDef> parameterTypes, ExpressionDef... values)
      The new instance expression.
      Parameters:
      parameterTypes - The constructor parameter types
      values - The constructor values
      Returns:
      The new instance
    • instantiate

      default ExpressionDef.NewInstance instantiate(List<TypeDef> parameterTypes, List<? extends ExpressionDef> values)
      The new instance expression.
      Parameters:
      parameterTypes - The constructor parameter types
      values - The constructor values
      Returns:
      The new instance
    • instantiate

      default ExpressionDef.NewInstance instantiate(Constructor<?> constructor, ExpressionDef... values)
      The new instance expression.
      Parameters:
      constructor - The constructor
      values - The constructor values
      Returns:
      The new instance
    • instantiate

      default ExpressionDef.NewInstance instantiate(Constructor<?> constructor, List<? extends ExpressionDef> values)
      The new instance expression.
      Parameters:
      constructor - The constructor
      values - The constructor values
      Returns:
      The new instance
    • instantiate

      default ExpressionDef.NewInstance instantiate(io.micronaut.inject.ast.MethodElement methodElement, List<? extends ExpressionDef> values)
      The new instance expression.
      Parameters:
      methodElement - The method element
      values - The constructor values
      Returns:
      The new instance
    • getStaticField

      default VariableDef.StaticField getStaticField(String name, TypeDef type)
      Get static field.
      Parameters:
      name - The field name
      type - The field type
      Returns:
      the get static field expression
      Since:
      1.5
    • getStaticField

      default VariableDef.StaticField getStaticField(FieldDef field)
      Get static field.
      Parameters:
      field - The field
      Returns:
      the get static field expression
      Since:
      1.5
    • getStaticField

      default VariableDef.StaticField getStaticField(Field field)
      Get static field.
      Parameters:
      field - The field
      Returns:
      the get static field expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(String name, TypeDef returningType, List<? extends ExpressionDef> values)
      Invoke static method.
      Parameters:
      name - The method name
      returningType - The return type
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.2
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(String name, List<TypeDef> parameterTypes, TypeDef returningType, List<? extends ExpressionDef> values)
      Invoke static method.
      Parameters:
      name - The method name
      parameterTypes - The parameter types
      returningType - The return type
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(String name, TypeDef returningType, ExpressionDef... values)
      Invoke static method.
      Parameters:
      name - The method name
      returningType - The return type
      values - The parameters
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(String name, List<TypeDef> parameterTypes, TypeDef returningType, ExpressionDef... values)
      Invoke static method.
      Parameters:
      name - The method name
      parameterTypes - The parameter types
      returningType - The return type
      values - The parameters
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(MethodDef method, ExpressionDef... values)
      Invoke static method.
      Parameters:
      method - The method
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(Method method, ExpressionDef... values)
      Invoke static method.
      Parameters:
      method - The method
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(Method method, List<? extends ExpressionDef> values)
      Invoke static method.
      Parameters:
      method - The method
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(io.micronaut.inject.ast.MethodElement methodElement, ExpressionDef... values)
      Invoke static method.
      Parameters:
      methodElement - The method element
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(io.micronaut.inject.ast.MethodElement methodElement, List<? extends ExpressionDef> values)
      Invoke static method.
      Parameters:
      methodElement - The method element
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • invokeStatic

      default ExpressionDef.InvokeStaticMethod invokeStatic(MethodDef method, List<? extends ExpressionDef> values)
      Invoke static method.
      Parameters:
      method - The method
      values - The values
      Returns:
      the invoke static method expression
      Since:
      1.5
    • of

      static ClassTypeDef of(Class<?> type)
      Create a new type definition.
      Parameters:
      type - The class
      Returns:
      type definition
    • of

      static ClassTypeDef of(String className)
      Create a new type definition.
      Parameters:
      className - The class name
      Returns:
      type definition
    • of

      static ClassTypeDef of(String className, boolean isInner)
      Create a new type definition.
      Parameters:
      className - The class name
      isInner - Is inner type
      Returns:
      type definition
      Since:
      1.5
    • of

      static ClassTypeDef of(io.micronaut.inject.ast.ClassElement classElement)
      Create a new type definition.
      Parameters:
      classElement - The class element
      Returns:
      type definition
    • of

      static ClassTypeDef of(ObjectDef objectDef)
      Create a new type definition.
      Parameters:
      objectDef - The object definition
      Returns:
      type definition
    • annotated

      default ClassTypeDef.AnnotatedClassTypeDef annotated(AnnotationDef... annotations)
      Define a ClassTypeDef with annotations.
      Specified by:
      annotated in interface TypeDef
      Parameters:
      annotations - the annotation definitions to be added
      Returns:
      The AnnotatedClassTypeDef
      Since:
      1.4
    • annotated

      default ClassTypeDef.AnnotatedClassTypeDef annotated(List<AnnotationDef> annotations)
      Define a ClassTypeDef with annotations.
      Specified by:
      annotated in interface TypeDef
      Parameters:
      annotations - The list of the AnnotationDef
      Returns:
      The AnnotatedClassTypeDef
      Since:
      1.4