Class AbstractExecutableMethod
java.lang.Object
io.micronaut.context.AbstractExecutableMethod
- All Implemented Interfaces:
EnvironmentConfigurable, io.micronaut.core.annotation.AnnotatedElement, io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Described, io.micronaut.core.naming.Named, io.micronaut.core.type.Executable, io.micronaut.core.type.UnsafeExecutable, ExecutableMethod, MethodReference
@Internal
public abstract class AbstractExecutableMethod
extends Object
implements io.micronaut.core.type.UnsafeExecutable, ExecutableMethod, EnvironmentConfigurable
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class<?>[]protected final Class<?> protected final StringFields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractExecutableMethod(Class<?> declaringType, String methodName) protectedAbstractExecutableMethod(Class<?> declaringType, String methodName, io.micronaut.core.type.Argument genericReturnType) protectedAbstractExecutableMethod(Class<?> declaringType, String methodName, io.micronaut.core.type.Argument genericReturnType, io.micronaut.core.type.Argument... arguments) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Environment environment) Configure the component for the given environment.booleanio.micronaut.core.annotation.AnnotationMetadataio.micronaut.core.type.Argument<?>[]Class<?>[]Class<?> io.micronaut.core.type.ReturnTypefinal MethodSoft resolves the targetMethodavoiding reflection until as late as possible.inthashCode()booleanfinal @Nullable Objectprotected abstract @Nullable ObjectinvokeInternal(Object instance, @Nullable Object[] arguments) @Nullable ObjectinvokeUnsafe(Object instance, @Nullable Object... arguments) protected io.micronaut.core.annotation.AnnotationMetadataResolves the annotation metadata for this method.protected MethodResolves the target method.toString()Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, 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, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, 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, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.type.Executable
getArgumentsMethods inherited from interface ExecutableMethod
getDescription, getDescription, isAbstract, isSuspendMethods inherited from interface MethodReference
getArgumentNames, getArguments, getName, getTargetMethod
-
Field Details
-
declaringType
-
methodName
-
argTypes
-
-
Constructor Details
-
AbstractExecutableMethod
protected AbstractExecutableMethod(Class<?> declaringType, String methodName, io.micronaut.core.type.Argument genericReturnType, io.micronaut.core.type.Argument... arguments) - Parameters:
declaringType- The declaring typemethodName- The method namegenericReturnType- The generic return typearguments- The arguments
-
AbstractExecutableMethod
-
AbstractExecutableMethod
-
-
Method Details
-
hasPropertyExpressions
public boolean hasPropertyExpressions()- Specified by:
hasPropertyExpressionsin interfaceio.micronaut.core.annotation.AnnotationMetadata- Specified by:
hasPropertyExpressionsin interfaceio.micronaut.core.annotation.AnnotationMetadataDelegate- Specified by:
hasPropertyExpressionsin interfaceEnvironmentConfigurable- Returns:
- Whether any environment specific property expressions exist in the object.
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
configure
Description copied from interface:EnvironmentConfigurableConfigure the component for the given environment.- Specified by:
configurein interfaceEnvironmentConfigurable- Parameters:
environment- The environment
-
equals
-
hashCode
public int hashCode() -
toString
-
getReturnType
public io.micronaut.core.type.ReturnType getReturnType()- Specified by:
getReturnTypein interfaceMethodReference- Returns:
- Return the return type
-
getArgumentTypes
- Specified by:
getArgumentTypesin interfaceMethodReference- Returns:
- The argument types
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceio.micronaut.core.type.Executable- Specified by:
getDeclaringTypein interfaceMethodReference- Returns:
- The bean that declares this injection point
-
getMethodName
- Specified by:
getMethodNamein interfaceMethodReference- Returns:
- The name of the method
-
invoke
-
invokeUnsafe
-
invokeInternal
-
resolveAnnotationMetadata
protected io.micronaut.core.annotation.AnnotationMetadata resolveAnnotationMetadata()Resolves the annotation metadata for this method. Subclasses- Returns:
- The
AnnotationMetadata
-
getArguments
public io.micronaut.core.type.Argument<?>[] getArguments()- Specified by:
getArgumentsin interfaceio.micronaut.core.type.Executable
-
getTargetMethod
Soft resolves the targetMethodavoiding reflection until as late as possible.- Returns:
- The method
- Throws:
NoSuchMethodError- if the method doesn't exist
-
resolveTargetMethod
-