Java Reflection Method Parameter getMethodParameterTypes(final Method method)

Here you can find the source of getMethodParameterTypes(final Method method)

Description

Get the list of parameter types for a given method.

License

Open Source License

Parameter

Parameter Description
method The method to get the parameter types of

Declaration

public static Class[] getMethodParameterTypes(final Method method) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
 * which accompanies this distribution./*  w ww.  j a  v  a2  s.co m*/
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *     Oracle - initial API and implementation from Oracle TopLink
 *     08/23/2010-2.2 Michael O'Brien 
 *        - 323043: application.xml module ordering may cause weaving not to occur causing an NPE.
 *                       warn if expected "_persistence_*_vh" method not found
 *                       instead of throwing NPE during deploy validation.
 *     30/05/2012-2.4 Guy Pelletier
 *       - 354678: Temp classloader is still being used during metadata processing
 *
 ******************************************************************************/

import java.lang.reflect.Method;

public class Main {
    /**
     * Get the list of parameter types for a given method.  Wrap the call in doPrivileged if necessary.
     * @param method The method to get the parameter types of
     */
    public static Class[] getMethodParameterTypes(final Method method) {
        return method.getParameterTypes();
    }
}

Related

  1. getMethodName(Method method, Class[] parameterClasses, String rightCode)
  2. getMethodParameterAnnotations(Method method, int index, Class annotationClass)
  3. getMethodParameterIndexes(final Method m)
  4. getMethodParameters(final Method method, final Map generics)
  5. getMethodParametersType(Class clazz, String methodName)
  6. getMethodQuietly(Class clazz, String methodName, Class... parameterTypes)
  7. getMethodRecursive(final Class clazz, final String methodName, final Class... parameterTypes)
  8. getMethodsWith(Class c, Class... parameters)
  9. getMethodUp(Class type, String name, Class... parameterTypes)