Package org.codehaus.jackson.jaxrs

Examples of org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider.readFrom()


       
        // 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


       
        // 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

    }
    int exitStatus = process.waitFor();
    assertEquals("php process json failed.", 0, exitStatus);

    FileInputStream fis = new FileInputStream(out);
    return (T) provider.readFrom((Class<Object>) object.getClass(), object.getClass(), null, null, null, fis);
  }

  protected String packageToModule(String pckg) {
    if (pckg == null) {
      return null;
View Full Code Here

    }
    int exitStatus = process.waitFor();
    assertEquals("ruby process json failed.", 0, exitStatus);

    FileInputStream fis = new FileInputStream(out);
    return (T) provider.readFrom((Class<Object>) object.getClass(), object.getClass(), null, null, null, fis);
  }

  protected String packageToModule(String pckg) {
    if (pckg == null) {
      return null;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.