Package com.thoughtworks.paranamer

Examples of com.thoughtworks.paranamer.CachingParanamer


* </ul>
*/
public class ParanamerConfiguration extends MostUsefulConfiguration {

    public ParanamerConfiguration() {
        useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));
    }
View Full Code Here


    @Test
    public void shouldInvokeBeforeOrAfterStepMethodWithMetaUsingParanamer() throws Exception {
        // Given
        SomeSteps stepsInstance = new SomeSteps();
        StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
        stepCreator.useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));
        Properties properties = new Properties();
        properties.put("theme", "shopping cart");

        // When
        Step stepWithMeta = stepCreator.createBeforeOrAfterStep(SomeSteps.methodFor("aMethodWithoutNamedAnnotation"),
View Full Code Here

    @Test
    public void shouldInvokeBeforeOrAfterStepMethodWithExpectedConvertedParametersFromMeta() throws Exception {
        // Given
        SomeSteps stepsInstance = new SomeSteps();
        StepCreator stepCreator = stepCreatorUsing(stepsInstance, mock(StepMatcher.class), new ParameterControls());
        stepCreator.useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));

        // When
        Date aDate = new Date();
        when(parameterConverters.convert(anyString(), eq(Date.class))).thenReturn(aDate);
        Step stepWithMeta = stepCreator.createBeforeOrAfterStep(SomeSteps.methodFor("aMethodWithDate"), new Meta());
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

     * default <code>BytecodeReadingParanamer</code>
     */
    protected final Paranamer _paranamer;

    public ParanamerModule() {
        this(new CachingParanamer(new BytecodeReadingParanamer()));
    }
View Full Code Here

    private static final long serialVersionUID = 1;

    protected final Paranamer _paranamer;

    public ParanamerOnJacksonAnnotationIntrospector() {
        this(new CachingParanamer(new BytecodeReadingParanamer()));
    }
View Full Code Here

    private static final long serialVersionUID = 1;

    protected final Paranamer _paranamer;

    public ParanamerOnJacksonAnnotationIntrospector() {
        this(new CachingParanamer(new BytecodeReadingParanamer()));
    }
View Full Code Here

    private static final long serialVersionUID = 1;

    protected final Paranamer _paranamer;

    public ParanamerOnJacksonAnnotationIntrospector() {
        this(new CachingParanamer(new BytecodeReadingParanamer()));
    }
View Full Code Here

        }
        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

  public ParanamerParameterNameProvider() {
    this( null );
  }

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

TOP

Related Classes of com.thoughtworks.paranamer.CachingParanamer

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.