当前位置: 首页>>代码示例>>Java>>正文


Java MoxyJsonConfig类代码示例

本文整理汇总了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());

}
 
开发者ID:yahoo,项目名称:parsec-libraries,代码行数:25,代码来源:JerseyValidationTest.java

示例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());
}
 
开发者ID:yahoo,项目名称:parsec-libraries,代码行数:10,代码来源:JerseyValidationTest.java

示例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();
}
 
开发者ID:Appverse,项目名称:appverse-server,代码行数:8,代码来源:SampleRestApplication.java

示例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;
}
 
开发者ID:apache,项目名称:lens,代码行数:11,代码来源:MoxyJsonConfigurationContextResolver.java

示例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(':');
}
 
开发者ID:anycook,项目名称:anycook-api,代码行数:9,代码来源:JsonMoxyConfigurationContextResolver.java

示例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;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:6,代码来源:MoxyJsonConfigResolver.java

示例8: getContext

import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
public MoxyJsonConfig getContext(Class<?> objectType) {
	return config;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:5,代码来源:MoxyJsonConfigResolver.java

示例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;
}
 
开发者ID:color-coding,项目名称:ibas-framework,代码行数:6,代码来源:JsonConfig.java

示例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();
}
 
开发者ID:BCDH,项目名称:TEI-Completer,代码行数:6,代码来源:JerseyClient.java

示例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();
  }
 
开发者ID:ameizi,项目名称:jersey2-restfull-examples,代码行数:6,代码来源:MyApplication.java

示例12: getContext

import org.glassfish.jersey.moxy.json.MoxyJsonConfig; //导入依赖的package包/类
@Override
public MoxyJsonConfig getContext(Class<?> objectType) {
    return config;
}
 
开发者ID:anycook,项目名称:anycook-api,代码行数:5,代码来源:JsonMoxyConfigurationContextResolver.java


注:本文中的org.glassfish.jersey.moxy.json.MoxyJsonConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。