Method

public class Method extends Executable

Stub implementation of Method. The actual implementation is in Method.h and Method.m, so the declared methods in this class should match the actual methods implemented in order to catch unsupported API references.

See Also

Inherited Constant Summary

Public Constructor Summary

Method()

Public Method Summary

AnnotatedType[]
AnnotatedType
<T extends Annotation> T
getAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if such an annotation is present, else null.
Annotation[]
getDeclaredAnnotations()
Returns annotations that are directly present on this element.
Class<?>
getDeclaringClass()
Returns the Class object representing the class or interface that declares the member or constructor represented by this Member.
Object
Class[]
Type[]
Type[]
Type
int
getModifiers()
Returns the Java language modifiers for the member or constructor represented by this Member, as an integer.
String
getName()
Returns the simple name of the underlying member or constructor represented by this Member.
Annotation[][]
Class[]<?>
Class<?>
TypeVariable[]<Method>
getTypeParameters()
Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order.
Object
boolean
boolean
boolean
isSynthetic()
Returns true if this member was introduced by the compiler; returns false otherwise.
boolean
String

Inherited Method Summary

Public Constructors

public Method ()

Public Methods

public AnnotatedType[] getAnnotatedParameterTypes ()

public AnnotatedType getAnnotatedReturnType ()

public T getAnnotation (Class<T> annotationClass)

Returns this element's annotation for the specified type if such an annotation is present, else null.

Parameters
annotationClass the Class object corresponding to the annotation type
Returns
  • this element's annotation for the specified annotation type if present on this element, else null

public Annotation[] getDeclaredAnnotations ()

Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.

Returns
  • annotations directly present on this element

public Class<?> getDeclaringClass ()

Returns the Class object representing the class or interface that declares the member or constructor represented by this Member.

Returns
  • an object representing the declaring class of the underlying member

public Object getDefaultValue ()

public Class[] getExceptionTypes ()

public Type[] getGenericExceptionTypes ()

public Type[] getGenericParameterTypes ()

public Type getGenericReturnType ()

public int getModifiers ()

Returns the Java language modifiers for the member or constructor represented by this Member, as an integer. The Modifier class should be used to decode the modifiers in the integer.

Returns
  • the Java language modifiers for the underlying member

public String getName ()

Returns the simple name of the underlying member or constructor represented by this Member.

Returns
  • the simple name of the underlying member

public Annotation[][] getParameterAnnotations ()

public Class[]<?> getParameterTypes ()

public Class<?> getReturnType ()

public TypeVariable[]<Method> getTypeParameters ()

Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order. Returns an array of length 0 if the underlying generic declaration declares no type variables.

Returns
  • an array of TypeVariable objects that represent the type variables declared by this generic declaration

public boolean isBridge ()

public boolean isDefault ()

public boolean isSynthetic ()

Returns true if this member was introduced by the compiler; returns false otherwise.

Returns
  • true if and only if this member was introduced by the compiler.

public boolean isVarArgs ()

public String toGenericString ()