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


Java JacksonJaxbJsonProvider类代码示例

本文整理汇总了Java中org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider的典型用法代码示例。如果您正苦于以下问题:Java JacksonJaxbJsonProvider类的具体用法?Java JacksonJaxbJsonProvider怎么用?Java JacksonJaxbJsonProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JacksonJaxbJsonProvider类属于org.codehaus.jackson.jaxrs包,在下文中一共展示了JacksonJaxbJsonProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSingletons

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
public HashSet<Object> getSingletons(){
	ObjectMapper mapper = new ObjectMapper();
	JacksonJaxbJsonProvider jaxbProvider = new JacksonJaxbJsonProvider();
    jaxbProvider.setMapper(mapper);
    singletons.add(jaxbProvider);

	if(Activator.BUNDLE==null){
		throw new IllegalArgumentException("WebSocketService.BUNDLE is null!");
	}
	
	IGuicer guicer = Guicer.getInstance(Activator.BUNDLE);
	
	//create the rest object make sure dependencies are injected via guice.
	IRestWebSocket restWebSocket = guicer.createObject(IRestWebSocket.class);
	
	
	if(restWebSocket==null){
		throw new IllegalArgumentException("restWebSocket is null!!!");
	}
	
	//add it
    singletons.add(restWebSocket);

	return singletons;

}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:27,代码来源:WebSocketService.java

示例2: getJSONResponse

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
static ClientResponse getJSONResponse(String url, String content_type) {
    ClientConfig config = new DefaultClientConfig();
    config.getClasses().add(JacksonJaxbJsonProvider.class);
    config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    WebResource webResource = getWebResource(url,config,content_type);
    return webResource.accept(content_type).get(ClientResponse.class);
}
 
开发者ID:mariaklimenko,项目名称:jeta,代码行数:8,代码来源:RestClient.java

示例3: postJSONResponse

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
static ClientResponse postJSONResponse(String url, String content_type,String body) {
    ClientConfig config = new DefaultClientConfig();
    config.getClasses().add(JacksonJaxbJsonProvider.class);
    config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    WebResource webResource = getWebResource(url,config,content_type);
    return webResource.accept(content_type).post(ClientResponse.class,body);
}
 
开发者ID:mariaklimenko,项目名称:jeta,代码行数:8,代码来源:RestClient.java

示例4: TestModelBase

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
protected TestModelBase(Class<?> clazz) throws Exception {
  super();
  this.clazz = clazz;
  context = new JAXBContextResolver().getContext(clazz);
  mapper = new JacksonJaxbJsonProvider().locateMapper(clazz,
      MediaType.APPLICATION_JSON_TYPE);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:TestModelBase.java

示例5: getService

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
/**
 * Returns a reference to the Data Quality service (proxy) to be used. 
 * 
 * @return A reference to the Data Quality service (proxy) to be used
 */
public DataQualityService getService()
{
	DataQualityService retVal = null;

	// set up providers
	List<Object> providers = new ArrayList<Object>();
	JacksonJaxbJsonProvider jsonProvider = new JacksonJaxbJsonProvider(new CustomObjectMapper(), DEFAULT_ANNOTATIONS);
	ErrorResponseExceptionMapper srvExMapper = new ErrorResponseExceptionMapper();
	
	providers.add(jsonProvider);
	providers.add(srvExMapper);
	
	if (endPoint != null)
	{
		// initialize proxy
		retVal  = JAXRSClientFactory.create(endPoint, DataQualityService.class, providers);
	}
	else // fall-back (local or non-NEO runtime env)
	{
		// TODO - remove hard-coded URL
		String remoteProxy = MessageFormat.format("https://dqaas{0}.hanatrial.ondemand.com/dq", System.getenv("HC_ACCOUNT"));
		retVal  = JAXRSClientFactory.create(remoteProxy, DataQualityService.class, providers);
	}
	
	return retVal;
}
 
开发者ID:SAP,项目名称:SAP-cloud-dqm-sample-java,代码行数:32,代码来源:DataQualityServiceFactory.java

示例6: createRESTClientProxy

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
@Override
protected <T> T createRESTClientProxy(String apiUrl, Class<T> proxy) {
    URI i = null;
    try {
        i = new URI(apiUrl);
    } catch (URISyntaxException ex) {
        throw new RuntimeException(ex);
    }
    ResteasyClientBuilder builder = new ResteasyClientBuilder();
    builder.connectionCheckoutTimeout(CONNECTION_SETUP_TO, TimeUnit.SECONDS);
    builder.socketTimeout(CONNECTION_SETUP_TO, TimeUnit.SECONDS);
    builder.httpEngine(new URLConnectionEngine());
    
    ResteasyProviderFactory.getInstance().register(builder);

    ResteasyClient client = builder.build();
    client.register(new ClientRequestFilter() {
        @Override
        public void filter(ClientRequestContext requestContext) throws IOException {
            requestContext.getHeaders().add("User-Agent", getImplementationName() + "=" + getVersion());
        }
    });
    ObjectMapper mapper = new ObjectMapper();
    JacksonJaxbJsonProvider jaxbProvider
            = new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);
    mapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector());

    mapper.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    builder.register(jaxbProvider);
    builder.register(proxy);

    ResteasyWebTarget resteasyWebTarget = client.target(i);
    return resteasyWebTarget.proxy(proxy);
}
 
开发者ID:gopaycommunity,项目名称:gopay-java-api,代码行数:35,代码来源:ResteasyGPConnector.java

示例7: getSingletons

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
@Override
public HashSet<Object> getSingletons(){
	ObjectMapper mapper = new ObjectMapper();
	JacksonJaxbJsonProvider jaxbProvider = new JacksonJaxbJsonProvider();
    jaxbProvider.setMapper(mapper);
    singletons.add(jaxbProvider);

	if(Activator.bundle==null){
		throw new IllegalArgumentException("WebSocketService.BUNDLE is null!");
	}
	
	IGuicer guicer = Guicer.getInstance(Activator.bundle);
	
	//create the rest object make sure dependencies are injected via guice.
	IRestWebSocket restWebSocket = guicer.createObject(IRestWebSocket.class);
	
	
	if(restWebSocket==null){
		throw new IllegalArgumentException("restWebSocket is null!!!");
	}
	
	//add it
    singletons.add(restWebSocket);

	return singletons;

}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:28,代码来源:WebSocketService.java

示例8: JiraRestAccess

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
public JiraRestAccess(String url, String user, String password) {
  this.restHome = url + JIRA_REST_API_SUFFIX;
  String userAndPassword = user + ':' + password;
  this.authentification = new String(Base64.getEncoder().encode(userAndPassword.getBytes()));

  JacksonJsonProvider jacksonJsonProvider =
      new JacksonJaxbJsonProvider().configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  objectMapper = jacksonJsonProvider.locateMapper(Object.class, MediaType.APPLICATION_JSON_TYPE);

  ClientConfig cfg = new DefaultClientConfig();
  cfg.getSingletons().add(jacksonJsonProvider);
  this.client = Client.create(cfg);
  // this.client.addFilter(new LoggingFilter(System.out));
}
 
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:15,代码来源:JiraRestAccess.java

示例9: configureServlets

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
@Override
protected void configureServlets() {
  bind(ClustersResource.class);
  bind(ConfigurationResource.class);
  bind(SchedulerStateResource.class);
  bind(ControllerResource.class);
  bind(ArtifactsResource.class);
  bind(GuiceContainer.class);
  bind(JacksonJaxbJsonProvider.class).in(Scopes.SINGLETON);

  serve("/api/*").with(GuiceContainer.class);
}
 
开发者ID:apache,项目名称:incubator-myriad,代码行数:13,代码来源:MyriadServletModule.java

示例10: getClasses

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
@Override
public Set<Class<?>> getClasses() {
    final Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(JacksonJaxbJsonProvider.class);
    classes.addAll(getRestRegistrationService().getClasses());
    return classes;
}
 
开发者ID:huihoo,项目名称:olat,代码行数:8,代码来源:OlatRestApplication.java

示例11: setUp

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    HippoRepositoryFactory.setDefaultRepository(background);
    super.setUp();
    startServer();
    client = WebClient.create(HTTP_ENDPOINT_ADDRESS, Collections.singletonList(new JacksonJaxbJsonProvider()), "admin", "admin", null);
}
 
开发者ID:jreijn,项目名称:hippo-addon-restful-webservices,代码行数:8,代码来源:WebservicesIntegrationTest.java

示例12: startServer

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
private static void startServer() throws Exception {
    Object jacksonJaxbJsonProvider = new JacksonJaxbJsonProvider();
    Object crossOriginResourceSharingFilter = new CrossOriginResourceSharingFilter();
    Object customWebApplicationExceptionMapper = new CustomWebApplicationExceptionMapper();
    Object hippoAuthenticationRequestHandler = new HippoAuthenticationRequestHandler();
    Object apiDeclarationProvider = new ApiDeclarationProvider();
    Object resourceListingProvider = new ResourceListingProvider();
    Object customJacksonConfig = new CustomJacksonConfig();

    List<Object> providers = new ArrayList<Object>();
    providers.add(customJacksonConfig);
    providers.add(jacksonJaxbJsonProvider);
    providers.add(crossOriginResourceSharingFilter);
    providers.add(customWebApplicationExceptionMapper);
    providers.add(hippoAuthenticationRequestHandler);
    providers.add(apiDeclarationProvider);
    providers.add(resourceListingProvider);

    List<Class<?>> serviceClasses = new ArrayList<Class<?>>();
    serviceClasses.add(ApiListingResourceJSON.class);
    serviceClasses.add(RootResource.class);
    serviceClasses.add(SystemResource.class);
    serviceClasses.add(NodesResource.class);
    serviceClasses.add(PropertiesResource.class);
    serviceClasses.add(QueryResource.class);
    serviceClasses.add(StatsResource.class);
    serviceClasses.add(UsersResource.class);
    serviceClasses.add(GroupsResource.class);

    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();

    sf.setProviders(providers);
    sf.setResourceClasses(serviceClasses);
    sf.setAddress(HTTP_ENDPOINT_ADDRESS);
    cxfServer = sf.create();
}
 
开发者ID:jreijn,项目名称:hippo-addon-restful-webservices,代码行数:37,代码来源:WebservicesIntegrationTest.java

示例13: JerseyConnector

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
public JerseyConnector(Logger logger) {
	if (logger != null)
		this.logger = new JerseyLoggingFilter(logger);
	ClientConfig clientConfig = new DefaultClientConfig();
	clientConfig.getClasses().add(JacksonJaxbJsonProvider.class);
	clientConfig.getClasses().add(OpenStackObjectMapper.class);
	client = Client.create(clientConfig);
}
 
开发者ID:jdutton,项目名称:java-openstack-sdk-cli-example,代码行数:9,代码来源:JerseyConnector.java

示例14: RESTApplication

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
@Inject
public RESTApplication(ServiceLocator serviceLocator) {
	log.info("Initialisation de l'application");
	classes.add(LdapResource.class);
	classes.add(NameNotFoundMapper.class);

	classes.add(MultiPartFeature.class);
	
	JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();
	singletons.add(provider);
	
	ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(SPRING_CONFIG);
	Rest2LdapConfig config = ctx.getBean("rest2ldapConfig", Rest2LdapConfig.class);
	ILdapDAO ldapDAO = ctx.getBean(ILdapDAO.class);
	
       DynamicConfiguration dc = Injections.getConfiguration(serviceLocator);
       Injections.addBinding(
               Injections.newBinder(ctx).to(ApplicationContext.class), dc);
       Injections.addBinding(
               Injections.newBinder(config).to(Rest2LdapConfig.class), dc);
       Injections.addBinding(
       		Injections.newBinder(ldapDAO).to(ILdapDAO.class), dc);

       dc.commit();

	testLdapConnection(ctx);        
}
 
开发者ID:lgangloff,项目名称:ldap2rest,代码行数:28,代码来源:RESTApplication.java

示例15: getSingletons

import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; //导入依赖的package包/类
public HashSet<Object> getSingletons(){
	ObjectMapper mapper = new ObjectMapper();
	JacksonJaxbJsonProvider jaxbProvider = new JacksonJaxbJsonProvider();
    jaxbProvider.setMapper(mapper);
    singletons.add(jaxbProvider);

	if(WebshellServiceActivator.BUNDLE==null){
		throw new IllegalArgumentException("WebshellServiceActivator.BUNDLE is null!");
	}
	
	IGuicer guicer = Guicer.getInstance(WebshellServiceActivator.BUNDLE);
	
	//create the rest object make sure dependencies are injected via guice.
	IRestWebshell restWebshell = (IRestWebshell) guicer.createObject(IRestWebshell.class);
	
	RestSimple restSimple = (RestSimple) guicer.createObject(RestSimple.class);
	
	if(restWebshell==null){
		throw new IllegalArgumentException("restWebshell is null!!!");
	}
	
	//add it
    singletons.add(restWebshell);
    singletons.add(restSimple);
    
	return singletons;

}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:29,代码来源:WebshellService.java


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