Package io.micronaut.core.beans
Class AbstractBeanMethod<B,T>
- java.lang.Object
-
- io.micronaut.core.beans.AbstractBeanMethod<B,T>
-
- Type Parameters:
B
- The bean typeT
- The return type
- All Implemented Interfaces:
AnnotationMetadataProvider
,AnnotationSource
,BeanMethod<B,T>
,Named
,Executable<B,T>
@Internal public abstract class AbstractBeanMethod<B,T> extends java.lang.Object implements BeanMethod<B,T>
Abstract implementation of theBeanMethod
interface.- Since:
- 2.3.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBeanMethod(BeanIntrospection<B> introspection, Argument<T> returnType, java.lang.String name, AnnotationMetadata annotationMetadata, Argument<?>... arguments)
Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AnnotationMetadata
getAnnotationMetadata()
Supplies the metadata.Argument<?>[]
getArguments()
The required argument types.BeanIntrospection<B>
getDeclaringBean()
java.lang.String
getName()
ReturnType<T>
getReturnType()
T
invoke(B instance, java.lang.Object... arguments)
Invokes the method.protected abstract T
invokeInternal(B instance, java.lang.Object... arguments)
Abstract implementation implemented by generated byte code.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Methods inherited from interface io.micronaut.core.beans.BeanMethod
getDeclaringType
-
-
-
-
Constructor Detail
-
AbstractBeanMethod
protected AbstractBeanMethod(@NonNull BeanIntrospection<B> introspection, @NonNull Argument<T> returnType, @NonNull java.lang.String name, @Nullable AnnotationMetadata annotationMetadata, @Nullable Argument<?>... arguments)
Default constructor.- Parameters:
introspection
- The associated introspectionreturnType
- The return typename
- The name of the methodannotationMetadata
- The annotation metadataarguments
- The argument types
-
-
Method Detail
-
getDeclaringBean
@NonNull public BeanIntrospection<B> getDeclaringBean()
- Specified by:
getDeclaringBean
in interfaceBeanMethod<B,T>
- Returns:
- The declaring bean introspection.
-
getReturnType
@NonNull public final ReturnType<T> getReturnType()
- Specified by:
getReturnType
in interfaceBeanMethod<B,T>
- Returns:
- The return type.
-
getAnnotationMetadata
@NonNull public final AnnotationMetadata getAnnotationMetadata()
Description copied from interface:AnnotationMetadataProvider
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Specified by:
getAnnotationMetadata
in interfaceAnnotationMetadataProvider
- Returns:
- The
AnnotationMetadata
-
getName
@NonNull public final java.lang.String getName()
-
getArguments
public final Argument<?>[] getArguments()
Description copied from interface:Executable
The required argument types.- Specified by:
getArguments
in interfaceExecutable<B,T>
- Returns:
- The arguments
-
invoke
public T invoke(@NonNull B instance, java.lang.Object... arguments)
Description copied from interface:Executable
Invokes the method.- Specified by:
invoke
in interfaceExecutable<B,T>
- Parameters:
instance
- The instance. Nullable only if it's a static method call.arguments
- The arguments- Returns:
- The result
-
-