Package io.micronaut.sourcegen.model
Class MethodDef
java.lang.Object
io.micronaut.sourcegen.model.MethodDef
The method definition.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The body builder.static final class
The method builder definition. -
Field Summary
Modifier and TypeFieldDescriptionprotected final List<AnnotationDef>
static final String
protected final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic MethodDef.MethodDefBuilder
static MethodDef.MethodDefBuilder
static MethodDef
constructor
(Collection<ParameterDef> parameterDefs, Modifier... modifiers) Create a new constructor with parameters assigned to fields with the same name.@Nullable ParameterDef
findParameter
(String name) final List<AnnotationDef>
final Modifier[]
final String
getName()
@NonNull ParameterDef
getParameter
(String name) boolean
boolean
static @NonNull MethodDef
of
(@NonNull io.micronaut.inject.ast.MethodElement methodElement) Creates a method definition fromMethodElement
.static @NonNull MethodDef
Creates a method definition fromMethod
.static @NonNull MethodDef.MethodDefBuilder
override
(@NonNull io.micronaut.inject.ast.MethodElement methodElement) Creates a method definition builder fromMethodElement
.static @NonNull MethodDef.MethodDefBuilder
override
(@NonNull Constructor<?> constructor) Creates a constructor definition builder fromMethod
.static @NonNull MethodDef.MethodDefBuilder
Creates a method definition builder fromMethod
.toString()
-
Field Details
-
CONSTRUCTOR
- See Also:
-
name
-
modifiers
-
annotations
-
javadoc
-
-
Method Details
-
constructor
- Returns:
- Starts a constructor.
-
constructor
Create a new constructor with parameters assigned to fields with the same name.- Parameters:
parameterDefs
- The parameters of the bodymodifiers
- The constructor modifiers- Returns:
- A new constructor with a body.
-
of
@NonNull public static @NonNull MethodDef of(@NonNull @NonNull io.micronaut.inject.ast.MethodElement methodElement) Creates a method definition fromMethodElement
.- Parameters:
methodElement
- The method element- Returns:
- The method definition
- Since:
- 1.5
-
of
Creates a method definition fromMethod
.- Parameters:
method
- The method- Returns:
- The method definition
- Since:
- 1.5
-
override
@NonNull public static @NonNull MethodDef.MethodDefBuilder override(@NonNull @NonNull io.micronaut.inject.ast.MethodElement methodElement) Creates a method definition builder fromMethodElement
.- Parameters:
methodElement
- The methodElement- Returns:
- The method definition builder
- Since:
- 1.5
-
override
@NonNull public static @NonNull MethodDef.MethodDefBuilder override(@NonNull @NonNull Method method) Creates a method definition builder fromMethod
.- Parameters:
method
- The method- Returns:
- The method definition builder
- Since:
- 1.5
-
override
@NonNull public static @NonNull MethodDef.MethodDefBuilder override(@NonNull @NonNull Constructor<?> constructor) Creates a constructor definition builder fromMethod
.- Parameters:
constructor
- The method- Returns:
- The method definition builder
- Since:
- 1.5
-
getReturnType
-
getParameters
-
getStatements
-
findParameter
-
getParameter
-
isOverride
public boolean isOverride()- Returns:
- True if method is an override
-
isConstructor
public boolean isConstructor()- Returns:
- True if method is a constructor
-
builder
-
toString
-
getName
-
getModifiers
-
getModifiersArray
-
getAnnotations
-
getJavadoc
-