Package com.fasterxml.classmate.members

Examples of com.fasterxml.classmate.members.ResolvedMethod


  }

  public List<ResolvedMethodParameter> methodParameters(final HandlerMethod methodToResolve) {
    Class hostClass = use(methodToResolve.getBeanType())
            .or(methodToResolve.getMethod().getDeclaringClass());
    ResolvedMethod resolvedMethod = getResolvedMethod(methodToResolve.getMethod(), hostClass);
    List<ResolvedMethodParameter> parameters = newArrayList();
    MethodParameter[] methodParameters = methodToResolve.getMethodParameters();
    if (resolvedMethod != null) {
      if (methodParameters.length == resolvedMethod.getArgumentCount()) {
        for (int index = 0; index < resolvedMethod.getArgumentCount(); index++) {
          MethodParameter methodParameter = methodParameters[index];
          methodParameter.initParameterNameDiscovery(new LocalVariableTableParameterNameDiscoverer());
          parameters.add(new ResolvedMethodParameter(methodParameter, resolvedMethod.getArgumentType(index)));
        }
      } else {
        log.warn(String.format("Problem trying to resolve a method named %s", methodToResolve.getMethod().getName()));
        log.warn(String.format("Method parameter count %s does not match resolved method argument count %s",
                methodParameters.length, resolvedMethod.getArgumentCount()));
      }
    }
    return parameters;
  }
View Full Code Here


   * @param methodToResolve a method which is declared in the implementing class or one of its subclasses
   * @param actualClass     the actual class. Used to resolve generic types if needed.
   * @return
   */
  public ResolvedType methodReturnType(final Method methodToResolve, Class<?> actualClass) {
    ResolvedMethod resolvedMethod = getResolvedMethod(methodToResolve, actualClass);
    if (resolvedMethod != null) {
      return returnTypeOrVoid(resolvedMethod);
    }
    return asResolved(typeResolver, methodToResolve.getReturnType());
  }
View Full Code Here

TOP

Related Classes of com.fasterxml.classmate.members.ResolvedMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.