Examples of lookupParameterNames()


Examples of com.thoughtworks.paranamer.Paranamer.lookupParameterNames()

        return 0;
    }

    private static Param[] getParameters(final Method method) {
        final Paranamer paranamer = new CachingParanamer(new BytecodeReadingParanamer());
        final String[] paramNames = paranamer.lookupParameterNames(method, false);
        final Type[]   types      = method.getGenericParameterTypes();
        final Param[]  params     = new Param[types.length];
        for (int i = 0; i < types.length; i++) {
            params[i] = new Param(paramNames[i], types[i]);
        }
View Full Code Here

Examples of com.thoughtworks.paranamer.Paranamer.lookupParameterNames()

        //
        // Build Parameter Infos
        // Extract parameter names from debug symbols
        Paranamer paranamer = new BytecodeReadingParanamer();
        String[] parameterNames = paranamer.lookupParameterNames(concreteMethod);
        Class<?>[] types = concreteMethod.getParameterTypes();

        // Parameter annotations used form descriptor come from the annotated method, not the public method
        Annotation[][] parameterAnnotations;
        if (annotatedMethod != null) {
View Full Code Here

Examples of com.thoughtworks.paranamer.Paranamer.lookupParameterNames()

    this.underlyingMethod = m;
    this.methodName = m.getName();
    this.returnType = m.getReturnType();
//    Paranamer para = new BytecodeReadingParanamer();
    Paranamer para = new AnnotationParanamer();
    String[] parameterNames = para.lookupParameterNames(m, true);
    if(parameterNames == null) throw new RuntimeException(String.format("Unable to read the parameter names for method %s.  This is likely due to the class files not including the appropriate debugging information.  Look up java -g for more information.", m));
    Class<?>[] types = m.getParameterTypes();
    if(parameterNames.length != types.length) throw new RuntimeException(String.format("Unexpected number of parameter names %s.  Expected %s on method %s.", Arrays.toString(parameterNames), Arrays.toString(types), m.toGenericString()));
    arguments = new CodeGeneratorArgument[parameterNames.length];
    for(int i =0 ; i < parameterNames.length; i++){
View Full Code Here

Examples of com.thoughtworks.paranamer.Paranamer.lookupParameterNames()

    public static <T> List<String> filterConstructorParameters(Class<T> target, Collection<String> names) {
    List<String> result = Collections.emptyList();
    Paranamer paranamer = new AdaptiveParanamer();
   
    for (Constructor<T> constructor : new Mirror().on(target).reflectAll().constructors()) {
      List<String> constructorParameterNames = Arrays.asList(paranamer.lookupParameterNames(constructor, false));
      if (result.size() < constructorParameterNames.size()) {
        if (names.containsAll(constructorParameterNames)
            && constructorParameterTypesMatch(target, constructorParameterNames, Arrays.asList(constructor.getParameterTypes())))
          result = constructorParameterNames;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.