@CallerSensitive
public Method getDeclaredMethod (String name, Class<?>… parameterTypes) throws NoSuchMethodException, SecurityException

Returns a Method object that reflects the specified declared method of the class or interface represented by this Class object. The name parameter is a String that specifies the simple name of the desired method, and the parameterTypes parameter is an array of Class objects that identify the method's formal parameter types, in declared order. If more than one method with the same parameter types is declared in a class, and one of these methods has a return type that is more specific than any of the others, that method is returned; otherwise one of the methods is chosen arbitrarily. If the name is "<init>"or "<clinit>" a NoSuchMethodException is raised.

If this Class object represents an array type, then this method does not find the clone() method.

Parameters:
name    the name of the method
parameterTypes    the parameter array

Returns:  the Method object for the method of this class matching the specified name and parameters

Exceptions:
NoSuchMethodException    if a matching method is not found.
NullPointerException    if name is null
SecurityException     If a security manager, s, is present and any of the following conditions is met:
  • the caller's class loader is not the same as the class loader of this class and invocation of s.checkPermission method with RuntimePermission("accessDeclaredMembers") denies access to the declared method
  • the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of s.checkPackageAccess() denies access to the package of this class

Since:  1.1

@jls 8.2 Class Members
@jls 8.4 Method Declarations