API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.lang.reflect. Method View Source
Author(s)
Kenneth Russell
Nakul Saraiya
Since
Version
Serial
Hierarchy
 Object
      AccessibleObject
          Method
Implements
 GenericDeclaration
 Member
Subclasses
Description
publicfinal class Method
  A Method provides information about, and access to, a single method on a class or interface.
Constructors
pack-private Method (Class declaringClass, String name, Class parameterTypes, Class returnType, Class checkedExceptions, int modifiers, int slot, String signature, byte[] annotations, byte[] parameterAnnotations, byte[] annotationDefault)
Package-private constructor used by ReflectAccess to enable instantiation of these objects in Java code from the java.lang package via sun.reflect.LangReflectAccess.
Methods
Hide/Show inherited methods
pack-private Method copy ()
  Package-private routine (exposed to java.lang.Class via ReflectAccess) which returns a copy of this Method.
public boolean equals (Object obj)
  Compares this Method against the specified object.
public T getAnnotation (Class< T> annotationClass) [Overrides AccessibleObject]
 
public Annotation getAnnotations () [Inherited From AccessibleObject]
 
public Annotation getDeclaredAnnotations () [Overrides AccessibleObject]
 
public Class<Object> getDeclaringClass () [Specified in Member]
Returns the Class object representing the class or interface that declares the method represented by this Method object.
public Object getDefaultValue ()
  Returns the default value for the annotation member represented by this Method instance.
public Class<Object> getExceptionTypes ()
  Returns an array of Class objects that represent the types of the exceptions declared to be thrown by the underlying method represented by this Method object.
public Type getGenericExceptionTypes ()
  Returns an array of Type objects that represent the exceptions declared to be thrown by this Method object.
public Type getGenericParameterTypes ()
  Returns an array of Type objects that represent the formal parameter types, in declaration order, of the method represented by this Method object.
public Type getGenericReturnType ()
  Returns a Type object that represents the formal return type of the method represented by this Method object.
pack-private sun.reflect.MethodAccessor getMethodAccessor ()
public int getModifiers () [Specified in Member]
  Returns the Java language modifiers for the method represented by this Method object, as an integer.
public String getName () [Specified in Member]
Returns the name of the method represented by this Method object, as a String.
public Annotation getParameterAnnotations ()
  Returns an array of arrays that represent the annotations on the formal parameters, in declaration order, of the method represented by this Method object.
public Class<Object> getParameterTypes ()
  Returns an array of Class objects that represent the formal parameter types, in declaration order, of the method represented by this Method object.
public Class<Object> getReturnType ()
  Returns a Class object that represents the formal return type of the method represented by this Method object.
public TypeVariable<Method> getTypeParameters () [Specified in GenericDeclaration]
  Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order.
public int hashCode ()
  Returns a hashcode for this Method.
public Object invoke (Object obj, Object args) throws IllegalAccessException IllegalArgumentException InvocationTargetException
  Invokes the underlying method represented by this Method object, on the specified object with the specified parameters.
public boolean isAccessible () [Inherited From AccessibleObject]
  Get the value of the accessible flag for this object.
public boolean isAnnotationPresent (Class<Annotation> annotationClass) [Inherited From AccessibleObject]
 
public boolean isBridge ()
  Returns true if this method is a bridge method; returns false otherwise.
public boolean isSynthetic () [Specified in Member]
  Returns true if this method is a synthetic method; returns false otherwise.
public boolean isVarArgs ()
  Returns true if this method was declared to take a variable number of arguments; returns false otherwise.
publicstatic void setAccessible (AccessibleObject array, boolean flag) throws SecurityException [Inherited From AccessibleObject]
  Convenience method to set the accessible flag for an array of objects with a single security check (for efficiency).
public void setAccessible (boolean flag) throws SecurityException [Inherited From AccessibleObject]
  Set the accessible flag for this object to the indicated boolean value.
pack-private void setMethodAccessor (sun.reflect.MethodAccessor accessor)
public String toGenericString ()
  Returns a string describing this Method, including type parameters.
public String toString ()
  Returns a string describing this Method.
Fields
Hide/Show inherited fields
publicfinalstatic int DECLARED = "1" [Inherited From Member]
  Identifies the set of declared members of a class or interface.
pack-private boolean override [Inherited From AccessibleObject]
publicfinalstatic int PUBLIC = "0" [Inherited From Member]
  Identifies the set of all public members of a class or interface, including inherited members.
pack-privatefinalstatic sun.reflect.ReflectionFactory reflectionFactory [Inherited From AccessibleObject]
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar