public interface MethodElement extends MemberElement
EMPTY_ELEMENT_ARRAY
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier and Type | Method and Description |
---|---|
default BeanElementBuilder |
addAssociatedBean(ClassElement type)
This method adds an associated bean using this method element as the originating element.
|
default java.lang.String |
getDescription(boolean simple)
Get the method description.
|
default ClassElement |
getGenericReturnType()
The generic return type of the method.
|
ParameterElement[] |
getParameters() |
ClassElement |
getReturnType() |
default ParameterElement[] |
getSuspendParameters()
If
isSuspend() returns true this method exposes the continuation parameter in addition to the other parameters of the method. |
default boolean |
hasParameters()
Returns true if the method has parameters.
|
default boolean |
isDefault()
Is the method a default method on an interfaces.
|
default boolean |
isSuspend()
Is the method a Kotlin suspend function.
|
static MethodElement |
of(ClassElement declaredType,
AnnotationMetadata annotationMetadata,
ClassElement returnType,
ClassElement genericReturnType,
java.lang.String name,
ParameterElement... parameterElements)
Creates a
MethodElement for the given parameters. |
MethodElement |
withNewParameters(ParameterElement... newParameters)
Takes this method element and transforms into a new method element with the given parameters appended to the existing parameters.
|
getDeclaringType, getModifiers, getOwningType
annotate, annotate, annotate, annotate, annotate, getDescription, getDocumentation, getName, getNativeType, getSimpleName, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
getAnnotationMetadata
@NonNull ClassElement getReturnType()
@NonNull ParameterElement[] getParameters()
@NonNull MethodElement withNewParameters(@NonNull ParameterElement... newParameters)
newParameters
- The new parameters@NonNull default BeanElementBuilder addAssociatedBean(@NonNull ClassElement type)
Note that this method can only be called on classes being directly compiled by Micronaut. If the ClassElement is
loaded from pre-compiled code an UnsupportedOperationException
will be thrown.
type
- The type of the bean@NonNull default ParameterElement[] getSuspendParameters()
isSuspend()
returns true this method exposes the continuation parameter in addition to the other parameters of the method.default boolean hasParameters()
default boolean isSuspend()
default boolean isDefault()
@NonNull default ClassElement getGenericReturnType()
@NonNull default java.lang.String getDescription(boolean simple)
getDescription
in interface Described
getDescription
in interface Element
simple
- If simple type names are to be used@NonNull static MethodElement of(@NonNull ClassElement declaredType, @NonNull AnnotationMetadata annotationMetadata, @NonNull ClassElement returnType, @NonNull ClassElement genericReturnType, @NonNull java.lang.String name, ParameterElement... parameterElements)
MethodElement
for the given parameters.declaredType
- The declaring typeannotationMetadata
- The annotation metadatareturnType
- The return typegenericReturnType
- The generic return typename
- The nameparameterElements
- The parameter elements