Package io.micronaut.sourcegen.model
Interface ClassTypeDef
- All Superinterfaces:
TypeDef
- All Known Implementing Classes:
ClassTypeDef.ClassDefType,ClassTypeDef.ClassElementType,ClassTypeDef.ClassName,ClassTypeDef.JavaClass,ClassTypeDef.Parameterized
public sealed interface ClassTypeDef
extends TypeDef
permits ClassTypeDef.ClassName, ClassTypeDef.JavaClass, ClassTypeDef.ClassElementType, ClassTypeDef.ClassDefType, ClassTypeDef.Parameterized
The class type definition.
Not-null by default.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA combined type for representing a ClassTypeDef with annotations.static final recordThe class def element type.static final recordThe class element type.static final recordThe class name type.static final recordThe class type.static final recordThe parameterized type definition.Nested classes/interfaces inherited from interface io.micronaut.sourcegen.model.TypeDef
TypeDef.Annotated, TypeDef.AnnotatedTypeDef, TypeDef.Array, TypeDef.Primitive, TypeDef.TypeVariable, TypeDef.Wildcard -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionannotated(AnnotationDef... annotations) Define a ClassTypeDef with annotations.annotated(List<AnnotationDef> annotations) Define a ClassTypeDef with annotations.default StringgetName()default Stringdefault Stringdefault VariableDef.StaticFieldgetStaticField(FieldDef field) Get static field.default VariableDef.StaticFieldgetStaticField(Field field) Get static field.default VariableDef.StaticFieldgetStaticField(String name, TypeDef type) Get static field.default ExpressionDef.NewInstanceinstantiate(io.micronaut.inject.ast.MethodElement methodElement, List<? extends ExpressionDef> values) The new instance expression.default ExpressionDef.NewInstanceinstantiate(ExpressionDef... values) The new instance expression.default ExpressionDef.NewInstanceinstantiate(Constructor<?> constructor, ExpressionDef... values) The new instance expression.default ExpressionDef.NewInstanceinstantiate(Constructor<?> constructor, List<? extends ExpressionDef> values) The new instance expression.default ExpressionDef.NewInstanceinstantiate(List<? extends ExpressionDef> values) The new instance expression.default ExpressionDef.NewInstanceinstantiate(List<TypeDef> parameterTypes, ExpressionDef... values) The new instance expression.default ExpressionDef.NewInstanceinstantiate(List<TypeDef> parameterTypes, List<? extends ExpressionDef> values) The new instance expression.default ExpressionDef.InvokeStaticMethodinvokeStatic(io.micronaut.inject.ast.MethodElement methodElement, ExpressionDef... values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(io.micronaut.inject.ast.MethodElement methodElement, List<? extends ExpressionDef> values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(MethodDef method, ExpressionDef... values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(MethodDef method, List<? extends ExpressionDef> values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(Method method, ExpressionDef... values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(Method method, List<? extends ExpressionDef> values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(String name, TypeDef returningType, ExpressionDef... values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(String name, TypeDef returningType, List<? extends ExpressionDef> values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(String name, List<TypeDef> parameterTypes, TypeDef returningType, ExpressionDef... values) Invoke static method.default ExpressionDef.InvokeStaticMethodinvokeStatic(String name, List<TypeDef> parameterTypes, TypeDef returningType, List<? extends ExpressionDef> values) Invoke static method.default booleanisEnum()default booleanisInner()default booleanstatic ClassTypeDefof(io.micronaut.inject.ast.ClassElement classElement) Create a new type definition.static ClassTypeDefCreate a new type definition.static ClassTypeDefCreate a new type definition.static ClassTypeDefCreate a new type definition.static ClassTypeDefCreate a new type definition.Methods inherited from interface io.micronaut.sourcegen.model.TypeDef
array, array, isArray, isNullable, isPrimitive
-
Field Details
-
OBJECT
-
-
Method Details
-
getName
String getName()- Returns:
- The type name
-
getCanonicalName
- Returns:
- The canonical type name
- Since:
- 1.5
-
getSimpleName
- Returns:
- The simple name
-
getPackageName
- Returns:
- The package name
-
makeNullable
ClassTypeDef makeNullable()- Specified by:
makeNullablein interfaceTypeDef- 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
The new instance expression.- Parameters:
values- The constructor values- Returns:
- The new instance
-
instantiate
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 typesvalues- 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 typesvalues- The constructor values- Returns:
- The new instance
-
instantiate
The new instance expression.- Parameters:
constructor- The constructorvalues- 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 constructorvalues- 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 elementvalues- The constructor values- Returns:
- The new instance
-
getStaticField
Get static field.- Parameters:
name- The field nametype- The field type- Returns:
- the get static field expression
- Since:
- 1.5
-
getStaticField
Get static field.- Parameters:
field- The field- Returns:
- the get static field expression
- Since:
- 1.5
-
getStaticField
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 namereturningType- The return typevalues- 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 nameparameterTypes- The parameter typesreturningType- The return typevalues- 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 namereturningType- The return typevalues- 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 nameparameterTypes- The parameter typesreturningType- The return typevalues- The parameters- Returns:
- the invoke static method expression
- Since:
- 1.5
-
invokeStatic
Invoke static method.- Parameters:
method- The methodvalues- The values- Returns:
- the invoke static method expression
- Since:
- 1.5
-
invokeStatic
Invoke static method.- Parameters:
method- The methodvalues- 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 methodvalues- 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 elementvalues- 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 elementvalues- 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 methodvalues- The values- Returns:
- the invoke static method expression
- Since:
- 1.5
-
of
Create a new type definition.- Parameters:
type- The class- Returns:
- type definition
-
of
Create a new type definition.- Parameters:
className- The class name- Returns:
- type definition
-
of
Create a new type definition.- Parameters:
className- The class nameisInner- Is inner type- Returns:
- type definition
- Since:
- 1.5
-
of
Create a new type definition.- Parameters:
classElement- The class element- Returns:
- type definition
-
of
Create a new type definition.- Parameters:
objectDef- The object definition- Returns:
- type definition
-
annotated
Define a ClassTypeDef with annotations. -
annotated
Define a ClassTypeDef with annotations.
-