Package io.micronaut.sourcegen.model
Class ObjectDef
java.lang.Object
io.micronaut.sourcegen.model.ObjectDef
- Direct Known Subclasses:
AnnotationObjectDef,ClassDef,EnumDef,InterfaceDef,RecordDef
public abstract sealed class ObjectDef
extends Object
permits ClassDef, EnumDef, InterfaceDef, RecordDef, AnnotationObjectDef
The abstract class representing a type: class, enum, interface or record.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<AnnotationDef>protected final ClassTypeDef.ClassNameprotected final Stringprotected final List<PropertyDef>protected final boolean -
Method Summary
Modifier and TypeMethodDescriptionGet the type definition for this type.final List<AnnotationDef>@NonNull TypeDefgetContextualType(@NonNull TypeDef typeDef) Get the actual contextual type.static @NonNull TypeDefgetContextualType(@Nullable ObjectDef objectDef, @NonNull TypeDef typeDef) Get a contextual type (converts this or super type to appropriate one).final Modifier[]final StringgetName()final Stringfinal List<PropertyDef>final Stringbooleanabstract ObjectDefwithClassName(ClassTypeDef.ClassName className) Creates a copy of this definition with a new class name.
-
Field Details
-
className
-
methods
-
properties
-
superinterfaces
-
innerTypes
-
name
-
modifiers
-
annotations
-
javadoc
-
synthetic
protected final boolean synthetic
-
-
Method Details
-
getMethods
-
getProperties
-
getSuperinterfaces
-
getPackageName
-
getSimpleName
-
getInnerTypes
-
withClassName
Creates a copy of this definition with a new class name.- Parameters:
className- The class name- Returns:
- the copy of this object definition with a new class name
- Since:
- 1.5
-
asTypeDef
Get the type definition for this type.- Returns:
- The type definition
-
getContextualType
Get the actual contextual type.- Parameters:
typeDef- The type- Returns:
- The contextual type or original type
- Since:
- 1.5
-
getContextualType
@NonNull public static @NonNull TypeDef getContextualType(@Nullable @Nullable ObjectDef objectDef, @NonNull @NonNull TypeDef typeDef) Get a contextual type (converts this or super type to appropriate one).- Parameters:
objectDef- The object deftypeDef- The type def- Returns:
- the contextual type or type def provider
- Since:
- 1.4
-
isSynthetic
public boolean isSynthetic()- Returns:
- Is synthetic element
-
getName
-
getModifiers
-
getModifiersArray
-
getAnnotations
-
getJavadoc
-