本文整理汇总了Java中com.thoughtworks.paranamer.CachingParanamer类的典型用法代码示例。如果您正苦于以下问题:Java CachingParanamer类的具体用法?Java CachingParanamer怎么用?Java CachingParanamer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CachingParanamer类属于com.thoughtworks.paranamer包,在下文中一共展示了CachingParanamer类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldInvokeBeforeOrAfterStepMethodWithMetaUsingParanamer
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
@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"),
new Meta(properties));
StepResult stepResult = stepWithMeta.perform(null);
// Then
assertThat(stepResult, instanceOf(Skipped.class));
assertThat((String) stepsInstance.args, is("shopping cart"));
}
示例2: shouldInvokeBeforeOrAfterStepMethodWithExpectedConvertedParametersFromMeta
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
@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());
StepResult stepResult = stepWithMeta.perform(null);
// Then
assertThat(stepResult, instanceOf(Skipped.class));
assertThat((Date) stepsInstance.args, is(aDate));
}
示例3: getContext
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
/** Get a context. */
@Override
public ValidationConfig getContext(Class<?> type) {
final ValidationConfig config = new ValidationConfig();
config.constraintValidatorFactory(resourceContext.getResource(InjectingConstraintValidatorFactory.class));
CachingParanamer paranamer = new CachingParanamer(new CustomAnnotationParanamer());
config.parameterNameProvider(new ParanamerParameterNameProvider(paranamer));
return config;
}
示例4: createErrorController
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
protected HttpHandler createErrorController(String error , Class<?> clazz , Class defaultClass){
clazz = clazz == null ? defaultClass : clazz;
ControllerMapping controllerMapping = new ControllerMapping( error , error);
controllerMapping.setControllerClass( clazz );
try {
Method handlerError = clazz.getMethod("handleError", OvertownRequest.class);
PathMapping methodMapping = new PathMapping( error , null , handlerError , getTemplate(handlerError) , handlerError.getAnnotation(JSONResponse.class) != null );
Paranamer paranamer = new CachingParanamer(new BytecodeReadingParanamer());
return new MainHttpHandler( controllerMapping , methodMapping , paranamer.lookupParameterNames( handlerError ) );
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
return null;
}
示例5: JaxRsParameterNameProvider
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
/**
* Default constructor using a custom annotation paranmer as first-priority provider.
*/
public JaxRsParameterNameProvider() {
super(new CachingParanamer(new AdaptiveParanamer(new JaxRsAnnotationParanamer(), new DefaultParanamer(), new BytecodeReadingParanamer())));
}
示例6: ParameterNameResolverParanamerImpl
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ParameterNameResolverParanamerImpl() {
paranamer = new CachingParanamer(new BytecodeReadingParanamer());
}
示例7: ViewParamsMerger
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ViewParamsMerger() {
this(new CachingParanamer(new AdaptiveParanamer(
/* new Java8Paranamer(), new AnnotationParanamer(), */new DefaultParanamer(),
new BytecodeReadingParanamer())));
}
示例8: HandlerCreator
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public HandlerCreator() {
paranamer = new CachingParanamer(new BytecodeReadingParanamer());
}
示例9: ControllerHandlerCreator
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ControllerHandlerCreator(){
paranamer = new CachingParanamer(new BytecodeReadingParanamer());
}
示例10: ParanamerConfiguration
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
public ParanamerConfiguration() {
useParanamer(new CachingParanamer(new BytecodeReadingParanamer()));
}
示例11: shouldUseCachingParanamer
import com.thoughtworks.paranamer.CachingParanamer; //导入依赖的package包/类
@Test
public void shouldUseCachingParanamer() {
assertThat(new ParanamerConfiguration().paranamer(), instanceOf(CachingParanamer.class));
}