Package com.strobel.reflection
Class MethodInfo
- java.lang.Object
-
- com.strobel.reflection.MemberInfo
-
- com.strobel.reflection.MethodBase
-
- com.strobel.reflection.MethodInfo
-
- All Implemented Interfaces:
java.lang.reflect.AnnotatedElement
- Direct Known Subclasses:
DelegatingMethodInfo
,DynamicMethod
,ErasedMethod
,GenericMethod
,MethodBuilder
,ReflectedMethod
,RuntimeMethodInfo
public abstract class MethodInfo extends MethodBase
-
-
Field Summary
Fields Modifier and Type Field Description protected MethodInfo
_erasedMethodDefinition
private static MethodInfo[]
EMPTY_METHODS
-
Fields inherited from class com.strobel.reflection.MemberInfo
EMPTY_ANNOTATIONS, ENUM_MODIFIER, VARARGS_MODIFIER
-
-
Constructor Summary
Constructors Constructor Description MethodInfo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilder
appendBriefDescription(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendDescription(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendErasedDescription(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendErasedSignature(java.lang.StringBuilder sb)
protected void
appendModifiers(java.lang.StringBuilder s, int modifiers)
java.lang.StringBuilder
appendSignature(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendSimpleDescription(java.lang.StringBuilder sb)
boolean
containsGenericParameter(Type<?> genericParameter)
boolean
containsGenericParameters()
(package private) static MethodInfo
declaredOn(MethodInfo method, Type<?> declaringType, Type<?> reflectedType)
static MethodInfo[]
emptyMethods()
MethodInfo
findBaseMethod(Type<?> relativeTo)
MethodInfo
findOverriddenMethod()
<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
java.lang.annotation.Annotation[]
getAnnotations()
java.lang.annotation.Annotation[]
getDeclaredAnnotations()
java.lang.Object
getDefaultValue()
MethodInfo
getErasedMethodDefinition()
MethodInfo
getGenericMethodDefinition()
TypeList
getGenericMethodParameters()
MemberType
getMemberType()
java.lang.String
getName()
abstract java.lang.reflect.Method
getRawMethod()
abstract Type<?>
getReturnType()
TypeList
getTypeArguments()
protected TypeBindings
getTypeBindings()
java.lang.Object
invoke(java.lang.Object instance, java.lang.Object... args)
boolean
isAbstract()
boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
boolean
isDefault()
boolean
isEquivalentTo(MemberInfo m)
boolean
isGenericMethod()
boolean
isGenericMethodDefinition()
MethodInfo
makeGenericMethod(Type<?>... typeArguments)
MethodInfo
makeGenericMethod(TypeList typeArguments)
(package private) static MethodInfo
reflectedOn(MethodInfo method, Type<?> reflectedType)
-
Methods inherited from class com.strobel.reflection.MethodBase
getCallingConvention, getParameters, getSignatureType, getThrownTypes
-
Methods inherited from class com.strobel.reflection.MemberInfo
appendGenericSignature, emptyAnnotations, equals, getAnnotationsByType, getBriefDescription, getDeclaredAnnotation, getDeclaredAnnotationsByType, getDeclaringType, getDescription, getErasedDescription, getErasedSignature, getModifiers, getReflectedType, getSignature, getSimpleDescription, hashCode, invalidateCaches, isFinal, isNonPublic, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, toString
-
-
-
-
Field Detail
-
EMPTY_METHODS
private static final MethodInfo[] EMPTY_METHODS
-
_erasedMethodDefinition
protected MethodInfo _erasedMethodDefinition
-
-
Method Detail
-
emptyMethods
public static MethodInfo[] emptyMethods()
-
isAbstract
public final boolean isAbstract()
-
isDefault
public final boolean isDefault()
-
getReturnType
public abstract Type<?> getReturnType()
-
getMemberType
public final MemberType getMemberType()
- Specified by:
getMemberType
in classMemberInfo
-
getRawMethod
public abstract java.lang.reflect.Method getRawMethod()
-
getDefaultValue
public java.lang.Object getDefaultValue()
-
getName
public java.lang.String getName()
- Specified by:
getName
in classMemberInfo
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotation
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getAnnotation
in classMemberInfo
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getAnnotations
in classMemberInfo
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotations
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getDeclaredAnnotations
in classMemberInfo
-
isEquivalentTo
public boolean isEquivalentTo(MemberInfo m)
- Overrides:
isEquivalentTo
in classMethodBase
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresent
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
isAnnotationPresent
in classMemberInfo
-
invoke
public java.lang.Object invoke(java.lang.Object instance, java.lang.Object... args)
-
findOverriddenMethod
public MethodInfo findOverriddenMethod()
-
findBaseMethod
public MethodInfo findBaseMethod(Type<?> relativeTo)
-
appendModifiers
protected void appendModifiers(java.lang.StringBuilder s, int modifiers)
-
appendDescription
public java.lang.StringBuilder appendDescription(java.lang.StringBuilder sb)
- Specified by:
appendDescription
in classMemberInfo
-
appendSimpleDescription
public java.lang.StringBuilder appendSimpleDescription(java.lang.StringBuilder sb)
- Specified by:
appendSimpleDescription
in classMemberInfo
-
appendBriefDescription
public java.lang.StringBuilder appendBriefDescription(java.lang.StringBuilder sb)
- Specified by:
appendBriefDescription
in classMemberInfo
-
appendErasedDescription
public java.lang.StringBuilder appendErasedDescription(java.lang.StringBuilder sb)
- Specified by:
appendErasedDescription
in classMemberInfo
-
appendSignature
public java.lang.StringBuilder appendSignature(java.lang.StringBuilder sb)
- Specified by:
appendSignature
in classMemberInfo
-
appendErasedSignature
public java.lang.StringBuilder appendErasedSignature(java.lang.StringBuilder sb)
- Specified by:
appendErasedSignature
in classMemberInfo
-
isGenericMethod
public boolean isGenericMethod()
-
isGenericMethodDefinition
public boolean isGenericMethodDefinition()
-
getTypeBindings
protected TypeBindings getTypeBindings()
-
getTypeArguments
public TypeList getTypeArguments()
-
getGenericMethodParameters
public TypeList getGenericMethodParameters()
-
getGenericMethodDefinition
public MethodInfo getGenericMethodDefinition()
-
getErasedMethodDefinition
public MethodInfo getErasedMethodDefinition()
-
containsGenericParameters
public boolean containsGenericParameters()
-
containsGenericParameter
public boolean containsGenericParameter(Type<?> genericParameter)
- Specified by:
containsGenericParameter
in classMethodBase
-
makeGenericMethod
public MethodInfo makeGenericMethod(Type<?>... typeArguments)
-
makeGenericMethod
public MethodInfo makeGenericMethod(TypeList typeArguments)
-
reflectedOn
static MethodInfo reflectedOn(MethodInfo method, Type<?> reflectedType)
-
declaredOn
static MethodInfo declaredOn(MethodInfo method, Type<?> declaringType, Type<?> reflectedType)
-
-