public class ArMethod extends Object
Method, except that it represents methods in Java source
(during annotation processing) vs. representing methods of runtime types.Method,
ExecutableElement| Modifier and Type | Method and Description |
|---|---|
E |
asElement()
Returns the underlying
Element for this object. |
boolean |
equals(Object o) |
static ArMethod |
forElement(ExecutableElement element)
Returns a method based on the specified element.
|
ArAnnotation |
getAnnotation(ArClass annotationClass)
Gets the annotation from the object that corresponds to the specified annotation type.
|
ArAnnotation |
getAnnotation(Class<? extends Annotation> annotationClass)
Gets the annotation from the object that corresponds to the specified annotation type.
|
<T extends Annotation> |
getAnnotationBridge(Class<T> annotationClass)
Gets an annotation bridge for the specified annotation type.
|
List<ArAnnotation> |
getAnnotations()
Gets all annotations for this object.
|
List<ArAnnotation> |
getDeclaredAnnotations()
Gets the annotations declared on this object.
|
ArClass |
getDeclaringClass()
Returns the class which declared this member.
|
Object |
getDefaultValue()
Returns the default value for an annotation method.
|
List<ArClass> |
getExceptionTypes()
Returns the list of declared exception types that can be thrown by this executable member.
|
List<ArType> |
getGenericExceptionTypes()
Returns the list of declared exception types that can be thrown by this executable memebr.
|
List<ArType> |
getGenericParameterTypes()
Returns the list of parameter types.
|
ArType |
getGenericReturnType()
Returns the method's return type.
|
EnumSet<ArModifier> |
getModifiers()
Returns the modifiers that apply to this member.
|
String |
getName()
Returns the member's name.
|
List<List<ArAnnotation>> |
getParameterAnnotations()
Returns lists of parameter annotations, one list for each parameter.
|
List<ArParameter<ArMethod>> |
getParameters()
Returns the method's list of parameters.
|
List<ArClass> |
getParameterTypes()
Returns the list of parameter types.
|
ArType |
getReceiverType()
Returns the method's receiver type or
null if the method is static. |
ArClass |
getReturnType()
Returns the method's return type.
|
List<ArTypeParameter<ArMethod>> |
getTypeParameters()
Returns the method's list of type variables.
|
int |
hashCode() |
boolean |
isAnnotationPresent(ArClass annotationClass)
Determines whether an annotation of the specified type exists on the object.
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
Determines whether an annotation of the specified type exists on the object.
|
boolean |
isVarArgs()
Determines whether this executable member can be invoked with variable arity (aka var-args).
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDeclaringClass, getModifiers, getNamegetAnnotation, getAnnotation, getAnnotationBridge, getDeclaredAnnotations, isAnnotationPresent, isAnnotationPresentpublic static ArMethod forElement(ExecutableElement element)
element - the elementNullPointerException - if the specified element is nullIllegalArgumentException - if the specified element does not represent a
methodpublic List<ArTypeParameter<ArMethod>> getTypeParameters()
getTypeParameters(), except that the return value has more
generic type information.getTypeParameters in interface ArGenericDeclarationpublic List<ArParameter<ArMethod>> getParameters()
getParameters(), except that the return value has more
generic type information.getParameters in interface ArExecutableMemberExecutable.getParameters(),
ExecutableElement.getParameters()public ArClass getReturnType()
getGenericReturnType().Method.getReturnType()public ArType getGenericReturnType()
Method.getGenericReturnType(),
ExecutableElement.getReturnType()public ArType getReceiverType()
null if the method is static. The type of the
receiver is always the type of declaring class. This method can be used to extract type
annotations that are declared for the method receiver.Executable.getAnnotatedReceiverType(),
ExecutableElement.getReceiverType()public Object getDefaultValue()
null is returned.
The type of the value is the same as found in the map returned by
ArAnnotation.getAnnotationAttributes().
null if this is
not an annotation methodMethod.getDefaultValue(),
ExecutableElement.getDefaultValue()public List<ArClass> getParameterTypes()
ArExecutableMemberArExecutableMember.getGenericParameterTypes().getParameterTypes in interface ArExecutableMemberExecutable.getParameterTypes()public List<ArType> getGenericParameterTypes()
ArExecutableMembergetGenericParameterTypes in interface ArExecutableMemberExecutable.getGenericParameterTypes()public boolean isVarArgs()
ArExecutableMemberisVarArgs in interface ArExecutableMemberExecutable.isVarArgs()public List<List<ArAnnotation>> getParameterAnnotations()
ArExecutableMembergetParameterAnnotations in interface ArExecutableMemberExecutable.getParameterAnnotations()public List<ArClass> getExceptionTypes()
ArExecutableMemberArExecutableMember.getGenericExceptionTypes().getExceptionTypes in interface ArExecutableMemberExecutable.getExceptionTypes()public List<ArType> getGenericExceptionTypes()
ArExecutableMembergetGenericExceptionTypes in interface ArExecutableMemberExecutable.getGenericExceptionTypes(),
ExecutableElement.getThrownTypes()public boolean equals(Object o)
public int hashCode()
public String toString()
public ArClass getDeclaringClass()
ArMembergetDeclaringClass in interface ArMemberMember.getDeclaringClass()public EnumSet<ArModifier> getModifiers()
ArMemberjava.lang.reflect.Member.getModifiers(), this
returns a set of modifiers (defined in an enum) instead of a bitmasked
integer.getModifiers in interface ArMemberMember.getModifiers()public String getName()
ArMemberpublic List<ArAnnotation> getAnnotations()
ArAnnotatedConstructgetAnnotations in interface ArAnnotatedConstructpublic E asElement()
ArAnnotatedElementElement for this object.asElement in interface ArAnnotatedElementpublic ArAnnotation getAnnotation(ArClass annotationClass)
ArAnnotatedConstructgetAnnotation in interface ArAnnotatedConstructannotationClass - the annotation typenull if there is no such annotationpublic ArAnnotation getAnnotation(Class<? extends Annotation> annotationClass)
ArAnnotatedConstructgetAnnotation in interface ArAnnotatedConstructannotationClass - the annotation typenull if there is no such annotationpublic <T extends Annotation> T getAnnotationBridge(Class<T> annotationClass)
ArAnnotatedConstructgetAnnotationBridge in interface ArAnnotatedConstructT - the type of the annotationannotationClass - the annotation typenull if
there is no such annotationArAnnotatedConstruct.getAnnotation(Class),
ArAnnotationBridge.createBridge(ArAnnotation, Class)public boolean isAnnotationPresent(ArClass annotationClass)
ArAnnotatedConstructisAnnotationPresent in interface ArAnnotatedConstructannotationClass - the annotation typepublic boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
ArAnnotatedConstructisAnnotationPresent in interface ArAnnotatedConstructannotationClass - the annotation typepublic List<ArAnnotation> getDeclaredAnnotations()
ArAnnotatedConstructgetDeclaredAnnotations in interface ArAnnotatedConstruct