@Internal public abstract class AbstractExecutableMethod extends Object implements 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
Modifier and Type | Field and Description |
---|---|
protected Class[] |
argTypes |
protected Class |
declaringType |
protected String |
methodName |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractExecutableMethod(Class<?> declaringType,
String methodName) |
protected |
AbstractExecutableMethod(Class<?> declaringType,
String methodName,
Argument genericReturnType) |
protected |
AbstractExecutableMethod(Class<?> declaringType,
String methodName,
Argument genericReturnType,
Argument... arguments) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Environment environment)
Configure the component for the given environment.
|
boolean |
equals(Object o) |
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
Argument<?>[] |
getArguments()
The required argument types.
|
Class[] |
getArgumentTypes() |
Class |
getDeclaringType() |
String |
getMethodName() |
ReturnType |
getReturnType() |
Method |
getTargetMethod()
Soft resolves the target
Method avoiding reflection until as late as possible. |
int |
hashCode() |
boolean |
hasPropertyExpressions()
Does the metadata contain any property expressions like
${foo.bar} . |
Object |
invoke(Object instance,
Object... arguments)
Invokes the method.
|
protected abstract Object |
invokeInternal(Object instance,
Object[] arguments) |
protected AnnotationMetadata |
resolveAnnotationMetadata()
Resolves the annotation metadata for this method.
|
protected Method |
resolveTargetMethod()
Resolves the target method.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDescription, getDescription, isAbstract, isSuspend
getArguments
getArgumentNames, getArguments, getName, getTargetMethod
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, 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
protected final Class declaringType
protected final String methodName
protected final Class[] argTypes
protected AbstractExecutableMethod(Class<?> declaringType, String methodName, Argument genericReturnType, Argument... arguments)
declaringType
- The declaring typemethodName
- The method namegenericReturnType
- The generic return typearguments
- The argumentsprotected AbstractExecutableMethod(Class<?> declaringType, String methodName, Argument genericReturnType)
declaringType
- The declaring typemethodName
- The method namegenericReturnType
- The generic return typepublic boolean hasPropertyExpressions()
AnnotationMetadata
${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.hasPropertyExpressions
in interface EnvironmentConfigurable
hasPropertyExpressions
in interface AnnotationMetadata
hasPropertyExpressions
in interface AnnotationMetadataDelegate
public AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
public void configure(Environment environment)
EnvironmentConfigurable
configure
in interface EnvironmentConfigurable
environment
- The environmentpublic boolean equals(Object o)
public int hashCode()
public ReturnType getReturnType()
getReturnType
in interface MethodReference
public Class[] getArgumentTypes()
getArgumentTypes
in interface MethodReference
public Class getDeclaringType()
getDeclaringType
in interface Executable
getDeclaringType
in interface MethodReference
public String getMethodName()
getMethodName
in interface MethodReference
public final Object invoke(Object instance, Object... arguments)
Executable
invoke
in interface Executable
instance
- The instancearguments
- The argumentsprotected abstract Object invokeInternal(Object instance, Object[] arguments)
instance
- The instancearguments
- The argumentsprotected AnnotationMetadata resolveAnnotationMetadata()
AnnotationMetadata
public Argument<?>[] getArguments()
Executable
getArguments
in interface Executable
public final Method getTargetMethod()
Method
avoiding reflection until as late as possible.NoSuchMethodError
- if the method doesn't exist