Package com.thoughtworks.paranamer

Examples of com.thoughtworks.paranamer.AdaptiveParanamer


        Class<?>[] types = getActionMethod().getParameterTypes();
        Annotation[][] annotations = getActionMethod().getParameterAnnotations();
        Object[] parameters = new Object[types.length];

        if (types.length > 0){
            Paranamer paranamer = new AdaptiveParanamer();
            String[] names = paranamer.lookupParameterNames(getActionMethod());
            for(int i=0; i<parameters.length; i++){
                BindingContext ctx = new BindingContext();
                ctx.setParameterName(names[i]);
                ctx.setParameterType(types[i]);
                ctx.setRequest(getRequest());
View Full Code Here


    }
  }
   
    public static <T> List<String> filterConstructorParameterNames(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() && names.containsAll(constructorParameterNames)) {
        result = constructorParameterNames;
      }
    }
   
View Full Code Here

  public NamedParametersMethod(Method method) {
    this.method = method;
  }

  public Parameter[] getParameters() {
        Paranamer paranamer = new CachingParanamer(new AdaptiveParanamer());
        String[] lookupParameterNames = paranamer.lookupParameterNames(method, true);
        Class<?>[] parameterTypes = method.getParameterTypes();
        return namedParametersFor(lookupParameterNames, parameterTypes);
       
  }
View Full Code Here

  public ParanamerParameterNameProvider() {
    this( null );
  }

  public ParanamerParameterNameProvider(Paranamer paranamer) {
    this.paranamer = paranamer != null ? paranamer : new CachingParanamer( new AdaptiveParanamer() );
    fallBackProvider = new DefaultParameterNameProvider();
  }
View Full Code Here

  public ParanamerParameterNameProvider() {
    this( null );
  }

  public ParanamerParameterNameProvider(Paranamer paranamer) {
    this.paranamer = paranamer != null ? paranamer : new CachingParanamer( new AdaptiveParanamer() );
    fallBackProvider = new DefaultParameterNameProvider();
  }
View Full Code Here

    }
  }
   
    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

Related Classes of com.thoughtworks.paranamer.AdaptiveParanamer

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.