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 theBeanMethodinterface.- Since:
- 2.3.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBeanMethod(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 AnnotationMetadatagetAnnotationMetadata()Supplies the metadata.Argument<?>[]getArguments()The required argument types.BeanIntrospection<B>getDeclaringBean()java.lang.StringgetName()ReturnType<T>getReturnType()Tinvoke(B instance, java.lang.Object... arguments)Invokes the method.protected abstract TinvokeInternal(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:
getDeclaringBeanin interfaceBeanMethod<B,T>- Returns:
- The declaring bean introspection.
-
getReturnType
@NonNull public final ReturnType<T> getReturnType()
- Specified by:
getReturnTypein interfaceBeanMethod<B,T>- Returns:
- The return type.
-
getAnnotationMetadata
@NonNull public final AnnotationMetadata getAnnotationMetadata()
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Returns:
- The
AnnotationMetadata
-
getName
@NonNull public final java.lang.String getName()
-
getArguments
public final Argument<?>[] getArguments()
Description copied from interface:ExecutableThe required argument types.- Specified by:
getArgumentsin interfaceExecutable<B,T>- Returns:
- The arguments
-
invoke
public T invoke(@NonNull B instance, java.lang.Object... arguments)
Description copied from interface:ExecutableInvokes the method.- Specified by:
invokein interfaceExecutable<B,T>- Parameters:
instance- The instancearguments- The arguments- Returns:
- The result
-
-