Class AbstractExecutableMethod<T,R>

java.lang.Object
io.micronaut.context.AbstractExecutableMethod<T,R>
Type Parameters:
T - The declaring type
R - The result of the method call
All Implemented Interfaces:
EnvironmentConfigurable, AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Named, Executable<T,R>, UnsafeExecutable<T,R>, ExecutableMethod<T,R>, MethodReference<T,R>

@Deprecated(since="5.0", forRemoval=true) @Internal public abstract class AbstractExecutableMethod<T,R> extends Object implements UnsafeExecutable<T,R>, ExecutableMethod<T,R>, EnvironmentConfigurable
Deprecated, for removal: This API element is subject to removal in a future version.
No longer needed

Abstract base class for generated ExecutableMethod classes to implement. The generated classes should implement the Executable.invoke(Object, Object...) method at compile time providing direct dispatch of the target method

Since:
1.0
Author:
Graeme Rocher
  • Field Details

    • declaringType

      protected final Class<T> declaringType
      Deprecated, for removal: This API element is subject to removal in a future version.
    • methodName

      protected final String methodName
      Deprecated, for removal: This API element is subject to removal in a future version.
    • argTypes

      protected final Class<?>[] argTypes
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractExecutableMethod

      protected AbstractExecutableMethod(Class<T> declaringType, String methodName, Argument<R> genericReturnType, Argument<?>... arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      declaringType - The declaring type
      methodName - The method name
      genericReturnType - The generic return type
      arguments - The arguments
    • AbstractExecutableMethod

      protected AbstractExecutableMethod(Class<T> declaringType, String methodName, Argument<R> genericReturnType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      declaringType - The declaring type
      methodName - The method name
      genericReturnType - The generic return type
    • AbstractExecutableMethod

      protected AbstractExecutableMethod(Class<T> declaringType, String methodName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      declaringType - The declaring type
      methodName - The method name
  • Method Details

    • hasPropertyExpressions

      public boolean hasPropertyExpressions()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: AnnotationMetadata
      Does the metadata contain any property expressions like ${foo.bar}. Note this by default returns true as previous versions of Micronaut must assume metadata is present. The compilation time this is computed in order to decide whether to instrument annotation metadata with environment specific logic.
      Specified by:
      hasPropertyExpressions in interface AnnotationMetadata
      Specified by:
      hasPropertyExpressions in interface AnnotationMetadataDelegate
      Specified by:
      hasPropertyExpressions in interface EnvironmentConfigurable
      Returns:
      True if property expressions are present
    • getAnnotationMetadata

      public AnnotationMetadata getAnnotationMetadata()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: AnnotationMetadataProvider
      Supplies the metadata. Defaults to AnnotationMetadata.EMPTY_METADATA.
      Specified by:
      getAnnotationMetadata in interface AnnotationMetadataProvider
      Returns:
      The AnnotationMetadata
    • configure

      public void configure(Environment environment)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: EnvironmentConfigurable
      Configure the component for the given environment.
      Specified by:
      configure in interface EnvironmentConfigurable
      Parameters:
      environment - The environment
    • equals

      public boolean equals(Object o)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object
    • getReturnType

      public ReturnType<R> getReturnType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getReturnType in interface MethodReference<T,R>
      Returns:
      Return the return type
    • getArgumentTypes

      public Class<?>[] getArgumentTypes()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getArgumentTypes in interface MethodReference<T,R>
      Returns:
      The argument types
    • getDeclaringType

      public Class<T> getDeclaringType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getDeclaringType in interface Executable<T,R>
      Specified by:
      getDeclaringType in interface MethodReference<T,R>
      Returns:
      The declaring type
    • getMethodName

      public String getMethodName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getMethodName in interface MethodReference<T,R>
      Returns:
      The name of the method
    • invoke

      public final @Nullable R invoke(T instance, @Nullable Object... arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Executable
      Invokes the method.
      Specified by:
      invoke in interface Executable<T,R>
      Parameters:
      instance - The instance. Nullable only if it's a static method call.
      arguments - The arguments
      Returns:
      The result
    • invokeUnsafe

      public @Nullable R invokeUnsafe(T instance, @Nullable Object... arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: UnsafeExecutable
      Invokes the method without the arguments' validation.
      Specified by:
      invokeUnsafe in interface UnsafeExecutable<T,R>
      Parameters:
      instance - The instance. Nullable only if it's a static method call.
      arguments - The arguments
      Returns:
      The result
    • invokeInternal

      protected abstract @Nullable R invokeInternal(T instance, @Nullable Object[] arguments)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      instance - The instance
      arguments - The arguments
      Returns:
      The result
    • resolveAnnotationMetadata

      protected AnnotationMetadata resolveAnnotationMetadata()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the annotation metadata for this method. Subclasses
      Returns:
      The AnnotationMetadata
    • getArguments

      public Argument<?>[] getArguments()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Executable
      The required argument types.
      Specified by:
      getArguments in interface Executable<T,R>
      Returns:
      The arguments
    • getTargetMethod

      public final Method getTargetMethod()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Soft resolves the target Method avoiding reflection until as late as possible.
      Returns:
      The method
      Throws:
      NoSuchMethodError - if the method doesn't exist
    • resolveTargetMethod

      protected Method resolveTargetMethod()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Resolves the target method.
      Returns:
      The target method