Package org.codehaus.jackson.jaxrs

Examples of org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider


        return classes;
    }

    @Override
    public Set<Object> getSingletons() {
        return Collections.<Object> singleton(new JacksonJaxbJsonProvider());
    }
View Full Code Here


        AnnotationIntrospector pair =
            new AnnotationIntrospector.Pair(new JaxbAnnotationIntrospector(),
                                            new JacksonAnnotationIntrospector());
        mapper.getDeserializationConfig().setAnnotationIntrospector(pair);
        mapper.getSerializationConfig().setAnnotationIntrospector(pair);
        this.jacksonProvider = new JacksonJaxbJsonProvider();
        jacksonProvider.setMapper(mapper);
    }
View Full Code Here

                .objectForString(response.getContentAsString())));
       
        // call the provider as though the wink-client was in use on the client side
        InputStream is = new ByteArrayInputStream(response.getContentAsByteArray());
        // use JacksonJaxbJsonProvider with default configuration instead of the old JacksonJsonProvider
        JacksonJaxbJsonProvider jacksonJAXBProvider = new JacksonJaxbJsonProvider();
        MyJAXBObject myJAXBObject = (MyJAXBObject)jacksonJAXBProvider.readFrom(Object.class, MyJAXBObject.class, null, MediaType.APPLICATION_JSON_TYPE, null, is);

        // make sure the Jackson deserializer is using the 'type' property on the XmlElement annotation in MyJAXBObject
        // confirm Jackson deserialized to expected object type -- support for this was added in Jackson 1.4
        assertTrue(myJAXBObject.getConfiguration() instanceof MyProperties);
    }
View Full Code Here

    protected Object[] getSingletons() {
        // this test checks to make sure we can override system providers (JsonProvider) to establish a new priority
        // last one listed takes priority
        // (note: this test relies on consistent behavior in MockServletInvocationTest.getSingletons() -- if this
        //  method re-orders the data return from here, test results may change)
        return new Object[] {new JacksonJaxbJsonProvider(), new JsonProvider()};
    }
View Full Code Here

        return new Class<?>[] {TestResource.class, PersonResource.class};
    }

    @Override
    protected Object[] getSingletons() {
      JacksonJaxbJsonProvider jacksonProvider = new JacksonJaxbJsonProvider();
        return new Object[] {jacksonProvider};
    }
View Full Code Here

        return new Class<?>[] {TestResource.class, PersonResource.class};
    }

    @Override
    protected Object[] getSingletons() {
        JacksonJaxbJsonProvider jacksonProvider = new JacksonJaxbJsonProvider();
        return new Object[] {jacksonProvider};
    }
View Full Code Here

  protected TestModelBase(Class<?> clazz) throws Exception {
    super();
    this.clazz = clazz;
    context = new JAXBContextResolver().getContext(clazz);
    mapper = new JacksonJaxbJsonProvider().locateMapper(clazz,
        MediaType.APPLICATION_JSON_TYPE);
  }
View Full Code Here

     *            the url
     * @return the created WebClient
     */
    private static WebClient createClient(String url) {

        JacksonJaxbJsonProvider jacksonJaxbJsonProvider = new JacksonJaxbJsonProvider();
        jacksonJaxbJsonProvider.configure(Feature.FAIL_ON_UNKNOWN_PROPERTIES,
                false);

        return WebClient.create(url,
                Collections.singletonList(jacksonJaxbJsonProvider)).accept(
                mediaTypes);
View Full Code Here

                .objectForString(response.getContentAsString())));
       
        // call the provider as though the wink-client was in use on the client side
        InputStream is = new ByteArrayInputStream(response.getContentAsByteArray());
        // use JacksonJaxbJsonProvider with default configuration instead of the old JacksonJsonProvider
        JacksonJaxbJsonProvider jacksonJAXBProvider = new JacksonJaxbJsonProvider();
        MyJAXBObject myJAXBObject = (MyJAXBObject)jacksonJAXBProvider.readFrom(Object.class, MyJAXBObject.class, null, MediaType.APPLICATION_JSON_TYPE, null, is);

        // make sure the Jackson deserializer is using the 'type' property on the XmlElement annotation in MyJAXBObject
        // confirm Jackson deserialized to expected object type -- support for this was added in Jackson 1.4
        assertTrue(myJAXBObject.getConfiguration() instanceof MyProperties);
    }
View Full Code Here

    protected ProxyConnectorService getProxyConnectorService()
    {
        ProxyConnectorService service =
            JAXRSClientFactory.create( getBaseUrl() + "/" + getRestServicesPath() + "/archivaServices/",
                                       ProxyConnectorService.class,
                                       Collections.singletonList( new JacksonJaxbJsonProvider() ) );

        WebClient.client( service ).header( "Authorization", authorizationHeader );
        WebClient.getConfig( service ).getHttpConduit().getClient().setReceiveTimeout( 300000L );
        return service;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.