本文整理汇总了Java中com.jayway.jsonpath.Configuration.setDefaults方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.setDefaults方法的具体用法?Java Configuration.setDefaults怎么用?Java Configuration.setDefaults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jayway.jsonpath.Configuration
的用法示例。
在下文中一共展示了Configuration.setDefaults方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: before
import com.jayway.jsonpath.Configuration; //导入方法依赖的package包/类
/**
* Override to set up your specific external resource.
*/
@Override
public void before() {
saveDefaults();
Configuration.setDefaults(new Defaults() {
private final JsonProvider jsonProvider = new JacksonJsonProvider();
private final MappingProvider mappingProvider = new JacksonMappingProvider();
@Override
public JsonProvider jsonProvider() {
return jsonProvider;
}
@Override
public MappingProvider mappingProvider() {
return mappingProvider;
}
@Override
public Set<Option> options() {
return EnumSet.noneOf(Option.class);
}
});
}
示例2: restoreDefaults
import com.jayway.jsonpath.Configuration; //导入方法依赖的package包/类
private void restoreDefaults() {
if (!this.hadDefaults) {
return;
}
Configuration.setDefaults(new Defaults() {
@Override
public JsonProvider jsonProvider() {
return jsonProvider;
}
@Override
public MappingProvider mappingProvider() {
return mappingProvider;
}
@Override
public Set<Option> options() {
return options;
}
});
}
示例3: setDefaults
import com.jayway.jsonpath.Configuration; //导入方法依赖的package包/类
public static void setDefaults() {
Configuration.setDefaults(new Configuration.Defaults() {
private final JsonProvider jsonProvider = new JacksonJsonProvider();
private final MappingProvider mappingProvider = new JacksonMappingProvider();
@Override
public JsonProvider jsonProvider() {
return jsonProvider;
}
@Override
public MappingProvider mappingProvider() {
return mappingProvider;
}
@Override
public Set<Option> options() {
return EnumSet.noneOf(Option.class);
}
});
}
示例4: afterPropertiesSet
import com.jayway.jsonpath.Configuration; //导入方法依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
Configuration.setDefaults(new Configuration.Defaults() {
private final JsonProvider jsonProvider = new JacksonJsonProvider();
@Override
public JsonProvider jsonProvider() {
return jsonProvider;
}
@Override
public Set<Option> options() {
return EnumSet.noneOf(Option.class);
}
@Override
public MappingProvider mappingProvider() {
return new JacksonMappingProvider();
}
});
}
示例5: initialize
import com.jayway.jsonpath.Configuration; //导入方法依赖的package包/类
@Override
public void initialize(Bootstrap<IronTestConfiguration> bootstrap) {
bootstrap.addBundle(new AssetsBundle("/assets/app", "/ui", "index.htm", "ui"));
bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/ui/lib", null, "uilib"));
bootstrap.addBundle(jaxWsBundle);
bootstrap.addBundle(new MultiPartBundle());
bootstrap.addBundle(new ViewBundle<IronTestConfiguration>(){
@Override
public Map<String, Map<String, String>> getViewConfiguration(IronTestConfiguration config) {
return config.getViewRendererConfiguration();
}
});
Configuration.setDefaults(new Configuration.Defaults() {
private final JsonProvider jsonProvider = new JacksonJsonProvider();
private final MappingProvider mappingProvider = new JacksonMappingProvider();
@Override
public JsonProvider jsonProvider() {
return jsonProvider;
}
@Override
public MappingProvider mappingProvider() {
return mappingProvider;
}
@Override
public Set<Option> options() {
return EnumSet.noneOf(Option.class);
}
});
}