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 List<? extends GenericPlaceholderElement> |
getDeclaredTypeVariables() |
default String |
getDescription(boolean simple)
Get the method description.
|
default ClassElement |
getGenericReturnType()
The generic return type of the method.
|
ParameterElement[] |
getParameters() |
default Optional<ClassElement> |
getReceiverType()
Returns the receiver type of this executable, or empty if the method has no receiver type.
|
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 ClassElement[] |
getThrownTypes()
Returns the types declared in the
throws declaration of a 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,
String name,
ParameterElement... parameterElements)
Creates a
MethodElement for the given parameters. |
default boolean |
overrides(MethodElement overridden)
Checks if this method element overrides another.
|
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, isReflectionRequired, isReflectionRequired
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, findRepeatableAnnotation, findRepeatableAnnotation, 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, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getAnnotationValuesByName, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
getAnnotationMetadata
@NonNull ClassElement getReturnType()
default List<? extends GenericPlaceholderElement> getDeclaredTypeVariables()
default Optional<ClassElement> getReceiverType()
Returns the receiver type of this executable, or empty if the method has no receiver type.
A MethodElement which is an instance method, or a constructor of an inner class, has a receiver type derived from the declaring type.
A MethodElement which is a static method, or a constructor of a non-inner class, or an initializer (static or instance), has no receiver type.
@NonNull default ClassElement[] getThrownTypes()
throws
declaration of a method.throws
types, if any. Never null
.@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 String getDescription(boolean simple)
getDescription
in interface Described
getDescription
in interface Element
simple
- If simple type names are to be useddefault boolean overrides(@NonNull MethodElement overridden)
overridden
- Possible overridden method@NonNull static MethodElement of(@NonNull ClassElement declaredType, @NonNull AnnotationMetadata annotationMetadata, @NonNull ClassElement returnType, @NonNull ClassElement genericReturnType, @NonNull 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