Look for ParamDescription annotations and attempt to call each annotated method.
511890
private void findParamDescMethods() {
        for (Method method : m_commandClass.getMethods()) {
            if (method.isAnnotationPresent(ParamDescription.class)) {
                try {
                    RESTParameter cmdParam = (RESTParameter) method.invoke(null, (Object[])null);
                    addParameter(cmdParam);
                } catch (Exception e) {
                    LOGGER.warn("Method '{}' for class '{}' could not be invoked: {}",
                                new Object[]{method.getName(), m_commandClass.getName(), e.toString()});
                }
            }
        }
    }
684085
public Hints findHint(Method method) {
        Hints hints = new Hints();
        for (Annotation annotation : method.getDeclaredAnnotations()) {
            findAllow(hints, annotation);
            findFormats(hints, annotation);
        }
        return hints;
    }
1155676
public static List<Method> findMethodsByNameAndNumParams(Object object, String method, int numParam) {
        LinkedList<Method> list = new LinkedList<Method>();
        Method[] methods = object.getClass().getMethods();
        for (Method m : methods) {
            String methodName = m.getName();
            if (ignoredMethodNames.indexOf(methodName) > -1) {
                log.debug("Skipping method: {}", methodName);
                continue;
            }
            if (log.isDebugEnabled()) {
                Class<?>[] params = m.getParameterTypes();
                log.debug("Method name: {} parameter count: {}", methodName, params.length);
                for (Class<?> param : params) {
                    log.debug("Parameter: {}", param);
                }
            }
            //check parameter length first since this should speed things up
            if (m.getParameterTypes().length != numParam) {
                log.debug("Param length not the same");
                continue;
            }
            //now try to match the name
            if (!methodName.equals(method)) {
                log.trace("Method name not the same");
                continue;
            }
            list.add(m);
        }
        return list;
    }
1165449
protected <View> void invokeAnnotatedViewMethods(final View view, final Class<? extends Annotation> annotation) {
        Class<?> handledClass = view.getClass();
        try {
            while (handledClass != null && !handledClass.equals(Object.class)) {
                for (final Method method : ClassReflection.getDeclaredMethods(handledClass)) {
                    if (Reflection.isAnnotationPresent(method, annotation)) {
                        invokeAnnotatedViewMethod(view, method);
                    }
                }
                handledClass = handledClass.getSuperclass();
            }
        } catch (final Exception exception) {
            throw new GdxRuntimeException("Unable to invoke method annotated with: " + annotation, exception);
        }
    }
530087
private static void doCheck(SqlFragmentContainer statement, HashMap<String, ParameterDeclaration> paramMap,
                         final MethodDeclaration method)
    {

        SqlFragment[] fragments = statement.getChildren();
        for (SqlFragment fragment : fragments) {

            // if the fragment is a container check all of its children.
            if (fragment instanceof SqlFragmentContainer) {
                doCheck((SqlFragmentContainer) fragment, paramMap, method);

                // reflection fragment - make sure it can be mapped using the method's param values.
            } else if (fragment instanceof ReflectionFragment) {
                checkReflectionFragment((ReflectionFragment) fragment, paramMap, method);
            }
        }
    }
13395
static Map<String, String> findQueryParams(String baseParam, Method method) {
        Map<String, String> hrefVars = new HashMap<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        for (int i = 0; i < parameterAnnotations.length; i++) {
            Annotation[] paramAnnotations = parameterAnnotations[i];
            for (Annotation paramAnnotation : paramAnnotations) {
                Class<?> parameterClass = method.getParameterTypes()[i];
                hrefVars.putAll(findQueryParamOnParameter(baseParam, parameterClass, paramAnnotation));
            }
        }
        return hrefVars;
    }
1227607
public void executeMethods(final List<Method> methods) throws Exception {

        for (final Method method : methods) {

            // TODO - curious about the findSuitableInstancesOf ? won't
            // method.getDeclaringClass be ok??

            for (final Object object : findSuitableInstancesOf(method.getDeclaringClass())) {

                method.invoke(object);

            }
        }
    }
237611
void handleRepeatableAnnotations(final Set<String> allRepeatableAnnotationNames) {
        if (annotationInfo != null) {
            annotationInfo.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(),
                    RelType.METHOD_ANNOTATIONS, RelType.CLASSES_WITH_METHOD_ANNOTATION);
        }
        if (parameterAnnotationInfo != null) {
            for (int i = 0; i < parameterAnnotationInfo.length; i++) {
                final AnnotationInfo[] pai = parameterAnnotationInfo[i];
                if (pai != null && pai.length > 0) {
                    boolean hasRepeatableAnnotation = false;
                    for (final AnnotationInfo ai : pai) {
                        if (allRepeatableAnnotationNames.contains(ai.getName())) {
                            hasRepeatableAnnotation = true;
                            break;
                        }
                    }
                    if (hasRepeatableAnnotation) {
                        final AnnotationInfoList aiList = new AnnotationInfoList(pai.length);
                        for (final AnnotationInfo ai : pai) {
                            aiList.add(ai);
                        }
                        // There is currently no RelType.CLASSES_WITH_METHOD_PARAMETER_ANNOTATION, so set
                        // RelType values to null
                        aiList.handleRepeatableAnnotations(allRepeatableAnnotationNames, getClassInfo(), null,
                                null);
                        parameterAnnotationInfo[i] = aiList.toArray(new AnnotationInfo[0]);
                    }
                }
            }
        }
    }
427566
public static List<Method> findMethods(Class<?> type,
			Class<? extends Annotation> annotation) {
		List<Method> list = new ArrayList<Method>();
		while (type != null) {
			for (Method method : type.getDeclaredMethods()) {
				if (method.getAnnotation(annotation) != null) {
					list.add(method);
				}
			}
			type = type.getSuperclass();
		}
		return list;
	}
702724
static Map<String, String> findPathParams(String baseParam, Method method) {
        Map<String, String> hrefVars = new HashMap<>();
        for (Annotation[] paramAnnotations : method.getParameterAnnotations()) {
            for (Annotation paramAnnotation : paramAnnotations) {
                if (paramAnnotation.annotationType().equals(PathParam.class)) {
                    String varName = ((PathParam) paramAnnotation).value();
                    addHrefVar(baseParam, hrefVars, varName);
                }
            }
        }
        return hrefVars;
    }
98785
protected static MethodDescriptor _buildMethodDescriptor(
    Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes, Class[] actualParameterTypes )
  {
    MethodDescriptor method;
    assert (parameterNames.length == parameterTypes.length) : "Number of parameter names different from number of parameter types.";
    assert (parameterNames.length == actualParameterTypes.length) :
            "Number of parameter names different from number of actual parameters.";

    try
    {
      int numParams = parameterNames.length;
      ParameterDescriptor[] parameters = new ParameterDescriptor[numParams];
      for( int i = 0; i < numParams; i++ )
      {
        parameters[i] = new TypedParameterDescriptor( parameterNames[i], parameterTypes[i] );
      }

      method = new MethodDescriptor( actionClass.getMethod( methodName, actualParameterTypes ), parameters );
    }
    catch( NoSuchMethodException e )
    {
      throw new RuntimeException( e );
    }
    catch( SecurityException e )
    {
      throw new RuntimeException( e );
    }
    return method;
  }
968092
private static Method getMethod(final Class<?> mbean,
                                  final String method,
                                  final String... params) {
    try {
      final ClassLoader loader = mbean.getClassLoader();
      final Class<?>[] paramClasses = new Class<?>[params.length];
      for (int i = 0; i < params.length; i++) {
        paramClasses[i] = primitives.get(params[i]);
        if (paramClasses[i] == null) {
          paramClasses[i] = Class.forName(params[i], false, loader);
        }
      }
      return mbean.getMethod(method, paramClasses);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      return null;
    }
  }
898693
private static List<Method> getMethodsWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotation, Logger log) {
    List<Method> annotatedMethods = new ArrayList<Method>();
    Method classMethods[] = clazz.getDeclaredMethods();
    for(Method classMethod : classMethods) {
      if(classMethod.isAnnotationPresent(annotation) && classMethod.getParameterTypes().length == 0) {
        if(!containsMethod(classMethod, annotatedMethods)) {
          annotatedMethods.add(classMethod);
        }
      }
    }
    Collections.sort(annotatedMethods, new Comparator<Method> () {

      @Override
      public int compare(Method method1, Method method2) {
        return method1.getName().compareTo(method2.getName());
      }
    });
    return annotatedMethods;
  }
395151
protected void scanMethods(ClassFile cf) {
        List<ClassFile> methods = cf.getMethods();
        if (methods == null)
            return;
        for (Object obj : methods) {
            MethodInfo method = (MethodInfo) obj;
            if (scanMethodAnnotations) {
                AnnotationsAttribute visible = (AnnotationsAttribute) method
                        .getAttribute(AnnotationsAttribute.visibleTag);
                AnnotationsAttribute invisible = (AnnotationsAttribute) method
                        .getAttribute(AnnotationsAttribute.invisibleTag);
                if (visible != null)
                    populate(visible.getAnnotations(), cf.getName());
                if (invisible != null)
                    populate(invisible.getAnnotations(), cf.getName());
            }
            if (scanParameterAnnotations) {
                ParameterAnnotationsAttribute paramsVisible = (ParameterAnnotationsAttribute) method
                        .getAttribute(ParameterAnnotationsAttribute.visibleTag);
                ParameterAnnotationsAttribute paramsInvisible = (ParameterAnnotationsAttribute) method
                        .getAttribute(ParameterAnnotationsAttribute.invisibleTag);
                if (paramsVisible != null && paramsVisible.getAnnotations() != null) {
                    for (Annotation[] anns : paramsVisible.getAnnotations()) {
                        populate(anns, cf.getName());
                    }
                }
                if (paramsInvisible != null && paramsInvisible.getAnnotations() != null) {
                    for (Annotation[] anns : paramsInvisible.getAnnotations()) {
                        populate(anns, cf.getName());
                    }
                }
            }
        }
    }
919348
def check_params_types(self, method):
        ''''''
        mn = method.__name__
        annos = dict(method.__annotations__)
        errors = []
        # Take a look at the syntax
        msg_tuple = 'Parameter {} in method {} is not annotated with a tuple.'
        msg_ptype = 'Parameter {} in method {} is not a valid Ptype.'
        msg_mod = 'Type for param {} in method {} must descend from Model.'
        msg_cls = 'Type for param {} in method {} must be instance (not class)'
        bodies = []
        for pname, anno in annos.items():
            if pname == 'return':
                continue
            elif len(anno) != 2:
                errors.append(msg_tuple.format(pname, mn))
            else:
                param_type, value_type = anno
                if param_type not in Ptypes:
                    errors.append(msg_ptype.format(pname, mn))
                elif param_type == 'body':
                    bodies.append(pname)
                elif param_type == 'path':
                    default = method.signature.parameters[pname].default
                    if default is not inspect._empty:
                        msg = ('Path prameter {} in method {} has a default '
                               'value ({}) that would make it optional (which '
                               'is wrong!)')
                        errors.append(msg.format(pname, mn, default))
                if hasattr(value_type, '__bases__'):
                    errors.append(msg_cls.format(pname, mn))
                elif Model not in value_type.__class__.__bases__:
                    errors.append(msg_mod.format(pname, mn))
        # Only one body parameter!
        if len(bodies) > 1:
            msg = 'Too many "Ptypes.body" params {} for method {} (max=1).'
            errors.append(msg.format(bodies, mn))
        return errors
1373676
private List<Class<?>> getValidJPAAnnotationsFromMethod(Class<?> clazz, Method method, int numberOfParams,
            Class<?> entityClazz)
    {
        List<Class<?>> annotations = new ArrayList<Class<?>>();

        for (Annotation methodAnnotation : method.getAnnotations())
        {
            Class<?> methodAnnotationType = methodAnnotation.annotationType();

            if (isValidJPAEntityListenerAnnotation(methodAnnotationType))
            {

                // verify method signature

                // verify exceptions
                boolean hasUncheckedExceptions = false;
                for (Class<?> exception : method.getExceptionTypes())
                {
                    if (!ReflectUtils.hasSuperClass(RuntimeException.class, exception))
                    {
                        hasUncheckedExceptions = true;
                        break;
                    }
                }

                if (hasUncheckedExceptions)
                {
                    log.info("Skipped method(" + clazz.getName() + "." + method.getName()
                            + ") Must not throw unchecked exceptions.");
                    continue;
                }

                // return type must be "void"
                if (!method.getReturnType().getSimpleName().equals("void"))
                {
                    log.info("Skipped method(" + clazz.getName() + "." + method.getName()
                            + ") Must have \"void\" return type.");
                    continue;
                }
                // argument must be an Entity or Object
                Class<?>[] paramTypes = method.getParameterTypes();
                if (paramTypes.length != numberOfParams)
                {
                    log.info("Skipped method(" + clazz.getName() + "." + method.getName() + ") Must have "
                            + numberOfParams + " parameter.");
                    continue;
                }

                if (numberOfParams == 1)
                {
                    Class<?> parameter = paramTypes[0];
                    if (!(parameter != null && parameter.isAssignableFrom(entityClazz)))
                    {
                        log.info("Skipped method(" + clazz.getName() + "." + method.getName()
                                + ") Must have only 1 \"Object\" type parameter.");
                        continue;
                    }
                }

                annotations.add(methodAnnotationType);
            }
        }
        return annotations;
    }
1282901
private static List<MethodParameterDto> _getMethodParams(Method method) {
        List<MethodParameterDto> result = new ArrayList<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        Class<?>[] parameterTypes = method.getParameterTypes();

        for (int i = 0; i < parameterTypes.length; i++) {
            Class<?> parameterType = parameterTypes[i];
            Annotation[] annotations = parameterAnnotations[i];

            if (annotations.length > 0) {
            	
            	if (Context.class.isAssignableFrom(annotations[0].getClass())) {
                	continue;
                }
            	
            	MethodParameterDto param = new MethodParameterDto();
                for (int j = 0; j < annotations.length; j++) {
                    Annotation annotation = annotations[j];
                        
                    if (QueryParam.class.isAssignableFrom(annotation.getClass())) {
                        QueryParam queryParam = QueryParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("query");
                    } else if (FormParam.class.isAssignableFrom(annotation.getClass())) {
                        FormParam queryParam = FormParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("form");
                    } else if (PathParam.class.isAssignableFrom(annotation.getClass())) {
                        PathParam queryParam = PathParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("path");
                    } else if (DefaultValue.class.isAssignableFrom(annotation.getClass())) {
                    	DefaultValue defaultValue = DefaultValue.class.cast(annotation);
                    	
                    	param.setDefaultValue(defaultValue.value());
                    }
                    
                    try {
                        if (BaseDto.class.isAssignableFrom(parameterType)) {
                            param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                        }
                    } catch (Exception ex) {
                        param.setSchema(parameterType);
                    }

                    String paramName = parameterType.getSimpleName().toLowerCase();
                    param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                }
                
                result.add(param);
            } else {
            	MethodParameterDto param = new MethodParameterDto();
                String paramName = parameterType.getSimpleName().toLowerCase();

                param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                param.setName("body");
                param.setParamType("body");
                try {
                    if (BaseDto.class.isAssignableFrom(parameterType)) {
                        param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                    }
                } catch (Exception ex) {
                    param.setSchema(parameterType);
                }
                result.add(param);
            } // end if-else
        } // end for
        return result;
    }