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_erasedMethodDefinitionprivate 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.StringBuilderappendBriefDescription(java.lang.StringBuilder sb)java.lang.StringBuilderappendDescription(java.lang.StringBuilder sb)java.lang.StringBuilderappendErasedDescription(java.lang.StringBuilder sb)java.lang.StringBuilderappendErasedSignature(java.lang.StringBuilder sb)protected voidappendModifiers(java.lang.StringBuilder s, int modifiers)java.lang.StringBuilderappendSignature(java.lang.StringBuilder sb)java.lang.StringBuilderappendSimpleDescription(java.lang.StringBuilder sb)booleancontainsGenericParameter(Type<?> genericParameter)booleancontainsGenericParameters()(package private) static MethodInfodeclaredOn(MethodInfo method, Type<?> declaringType, Type<?> reflectedType)static MethodInfo[]emptyMethods()MethodInfofindBaseMethod(Type<?> relativeTo)MethodInfofindOverriddenMethod()<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)java.lang.annotation.Annotation[]getAnnotations()java.lang.annotation.Annotation[]getDeclaredAnnotations()java.lang.ObjectgetDefaultValue()MethodInfogetErasedMethodDefinition()MethodInfogetGenericMethodDefinition()TypeListgetGenericMethodParameters()MemberTypegetMemberType()java.lang.StringgetName()abstract java.lang.reflect.MethodgetRawMethod()abstract Type<?>getReturnType()TypeListgetTypeArguments()protected TypeBindingsgetTypeBindings()java.lang.Objectinvoke(java.lang.Object instance, java.lang.Object... args)booleanisAbstract()booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)booleanisDefault()booleanisEquivalentTo(MemberInfo m)booleanisGenericMethod()booleanisGenericMethodDefinition()MethodInfomakeGenericMethod(Type<?>... typeArguments)MethodInfomakeGenericMethod(TypeList typeArguments)(package private) static MethodInforeflectedOn(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:
getMemberTypein classMemberInfo
-
getRawMethod
public abstract java.lang.reflect.Method getRawMethod()
-
getDefaultValue
public java.lang.Object getDefaultValue()
-
getName
public java.lang.String getName()
- Specified by:
getNamein classMemberInfo
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotationin interfacejava.lang.reflect.AnnotatedElement- Overrides:
getAnnotationin classMemberInfo
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotationsin interfacejava.lang.reflect.AnnotatedElement- Overrides:
getAnnotationsin classMemberInfo
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotationsin interfacejava.lang.reflect.AnnotatedElement- Overrides:
getDeclaredAnnotationsin classMemberInfo
-
isEquivalentTo
public boolean isEquivalentTo(MemberInfo m)
- Overrides:
isEquivalentToin classMethodBase
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresentin interfacejava.lang.reflect.AnnotatedElement- Overrides:
isAnnotationPresentin 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:
appendDescriptionin classMemberInfo
-
appendSimpleDescription
public java.lang.StringBuilder appendSimpleDescription(java.lang.StringBuilder sb)
- Specified by:
appendSimpleDescriptionin classMemberInfo
-
appendBriefDescription
public java.lang.StringBuilder appendBriefDescription(java.lang.StringBuilder sb)
- Specified by:
appendBriefDescriptionin classMemberInfo
-
appendErasedDescription
public java.lang.StringBuilder appendErasedDescription(java.lang.StringBuilder sb)
- Specified by:
appendErasedDescriptionin classMemberInfo
-
appendSignature
public java.lang.StringBuilder appendSignature(java.lang.StringBuilder sb)
- Specified by:
appendSignaturein classMemberInfo
-
appendErasedSignature
public java.lang.StringBuilder appendErasedSignature(java.lang.StringBuilder sb)
- Specified by:
appendErasedSignaturein 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:
containsGenericParameterin 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)
-
-