Example usage for Java java.lang.reflect Method fields, constructors, methods, implement or subclass
The text is from its open source code.
String | name |
boolean | equals(Object obj) Compares this Method against the specified object. |
AnnotatedType | getAnnotatedReturnType() |
T | getAnnotation(Class |
Annotation[] | getAnnotations() |
T[] | getAnnotationsByType(Class |
Class> | getClass() Returns the runtime class of this Object . |
T | getDeclaredAnnotation(Class |
Annotation[] | getDeclaredAnnotations() |
Class> | getDeclaringClass() Returns the Class object representing the class or interface that declares the method represented by this object. |
Object | getDefaultValue() Returns the default value for the annotation member represented by this Method instance. |
Class>[] | getExceptionTypes() |
Type[] | getGenericExceptionTypes() |
Type[] | getGenericParameterTypes() |
Type | getGenericReturnType() Returns a Type object that represents the formal return type of the method represented by this Method object. |
int | getModifiers() |
String | getName() Returns the name of the method represented by this Method object, as a String . |
Annotation[][] | getParameterAnnotations() |
int | getParameterCount() |
Parameter[] | getParameters() Returns an array of Parameter objects that represent all the parameters to the underlying executable represented by this object. |
Class>[] | getParameterTypes() |
Class> | getReturnType() Returns a Class object that represents the formal return type of the method represented by this Method object. |
TypeVariable | getTypeParameters() |
int | hashCode() Returns a hashcode for this Method . |
Object | invoke(Object obj, Object... args) Invokes the underlying method represented by this Method object, on the specified object with the specified parameters. |
boolean | isAccessible() Get the value of the accessible flag for this reflected object. |
boolean | isAnnotationPresent(Class extends Annotation> annotationClass) |
boolean | isBridge() Returns true if this method is a bridge method; returns false otherwise. |
boolean | isDefault() Returns true if this method is a default method; returns false otherwise. |
boolean | isSynthetic() |
boolean | isVarArgs() |
void | setAccessible(boolean flag) |
String | toGenericString() Returns a string describing this Method , including type parameters. |
String | toString() Returns a string describing this Method . |