本文整理汇总了Java中org.glassfish.jersey.moxy.json.MoxyJsonConfig类的典型用法代码示例。如果您正苦于以下问题:Java MoxyJsonConfig类的具体用法?Java MoxyJsonConfig怎么用?Java MoxyJsonConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MoxyJsonConfig类属于org.glassfish.jersey.moxy.json包,在下文中一共展示了MoxyJsonConfig类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configure
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
protected Application configure() {
//enable(TestProperties.LOG_TRAFFIC);
//enable(TestProperties.DUMP_ENTITY);
//
// TODO: load web.xml directly
// .property(
// "contextConfigLocation",
// "classpath:**/my-web-test-context.xml"
//
return new ResourceConfig(MyResource.class)
.register(ParsecMoxyProvider.class)
.register(JaxbExceptionMapper.class)
.property(JaxbExceptionMapper.PROP_JAXB_DEFAULT_ERROR_CODE, JAXB_ERROR_CODE)
.property(JaxbExceptionMapper.PROP_JAXB_DEFAULT_ERROR_MSG, JAXB_ERROR_MSG)
.register(ValidationConfigurationContextResolver.class)
.register(ParsecValidationExceptionMapper.class)
.property(ParsecValidationExceptionMapper.PROP_VALIDATION_DEFAULT_ERROR_CODE, VALIDATION_ERROR_CODE)
.property(ParsecValidationExceptionMapper.PROP_VALIDATION_DEFAULT_ERROR_MSG, VALIDATION_ERROR_MSG)
.property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, true)
.register(new MoxyJsonConfig().setFormattedOutput(true)
.property(MarshallerProperties.BEAN_VALIDATION_MODE, BeanValidationMode.NONE).resolver());
}
示例2: getContext
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
public MoxyJsonConfig getContext(Class<?> objectType) {
MoxyJsonConfig configuration = new MoxyJsonConfig();
Map<String, String> namespacePrefixMapper = new HashMap<>(1);
namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
configuration.setNamespacePrefixMapper(namespacePrefixMapper);
configuration.setNamespaceSeparator(':');
return configuration;
}
开发者ID:RETIT,项目名称:continuous-performance-evaluation,代码行数:12,代码来源:JsonMoxyConfigurationContextResolver.java
示例3: configureClient
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
protected void configureClient(final ClientConfig config) {
super.configureClient(config);
config.register(MoxyJsonFeature.class)
.property(ClientProperties.METAINF_SERVICES_LOOKUP_DISABLE, true)
.register(new MoxyJsonConfig().setFormattedOutput(true)
// Turn off BV otherwise the entities on server would be validated by MOXy as well.
.property(MarshallerProperties.BEAN_VALIDATION_MODE, BeanValidationMode.NONE).resolver());
}
示例4: createMoxyJsonResolver
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig();
//Map<String, String> namespacePrefixMapper = new HashMap<String, String>(1);
//namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
//moxyJsonConfig.setNamespacePrefixMapper(namespacePrefixMapper).setNamespaceSeparator(':');
return moxyJsonConfig.resolver();
}
示例5: getContext
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
public MoxyJsonConfig getContext(final Class<?> type) {
final MoxyJsonConfig configuration = new MoxyJsonConfig();
configuration.setIncludeRoot(true);
configuration.setFormattedOutput(true);
configuration.setMarshalEmptyCollections(false);
configuration.marshallerProperty(MarshallerProperties.JSON_WRAPPER_AS_ARRAY_NAME, true);
configuration.unmarshallerProperty(MarshallerProperties.JSON_WRAPPER_AS_ARRAY_NAME, true);
return configuration;
}
示例6: JsonMoxyConfigurationContextResolver
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
public JsonMoxyConfigurationContextResolver() {
final Map<String, String> namespacePrefixMapper = new HashMap<>();
namespacePrefixMapper.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
config = new MoxyJsonConfig().setFormattedOutput(true)
.setNamespacePrefixMapper(namespacePrefixMapper)
.setNamespaceSeparator(':');
}
示例7: MoxyJsonConfigResolver
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
public MoxyJsonConfigResolver() {
MoxyJsonConfig jsonConfig = new MoxyJsonConfig();
jsonConfig.property(JAXBContextProperties.JSON_WRAPPER_AS_ARRAY_NAME, true);
this.config = jsonConfig;
}
示例8: getContext
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
public MoxyJsonConfig getContext(Class<?> objectType) {
return config;
}
示例9: JsonConfig
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
public JsonConfig() {
MoxyJsonConfig jsonConfig = new MoxyJsonConfig();
jsonConfig.property(JAXBContextProperties.JSON_WRAPPER_AS_ARRAY_NAME, true);
this.config = jsonConfig;
}
示例10: createMoxyJsonResolver
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
final MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig();
moxyJsonConfig.setNamespacePrefixMapper(namespacePrefixMapper).setNamespaceSeparator(':');
return moxyJsonConfig.resolver();
}
示例11: createMoxyJsonResolver
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
public static ContextResolver<MoxyJsonConfig> createMoxyJsonResolver() {
MoxyJsonConfig moxyJsonConfig = new MoxyJsonConfig();
moxyJsonConfig.setFormattedOutput(true);//格式化json
return moxyJsonConfig.resolver();
}
示例12: getContext
import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
public MoxyJsonConfig getContext(Class<?> objectType) {
return config;
}