@Override public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { return jaxbProvider.isReadable(type, genericType, annotations, mediaType) ? jaxbProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream) : pojoProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream); }
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return delegate.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream); } }
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return delegate.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream); } }
/** * Reads from a stream to create an object. Closes the input stream */ public static <T>T read(Class<T> objectType, InputStream in) throws IOException { try { // this is lame but needed to get it to compile Class<Object> foo = (Class<Object>) JsonObjectMapper.class.getClassLoader().loadClass(objectType.getName()); return (T) createProvider().readFrom(foo, objectType, null, MediaType.APPLICATION_JSON_TYPE, null, in); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } finally { IOUtils.closeQuietly(in); } }
@Override public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { return jaxbProvider.isReadable(type, genericType, annotations, mediaType) ? jaxbProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream) : pojoProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream); }
@Override public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { return jaxbProvider.isReadable(type, genericType, annotations, mediaType) ? jaxbProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream) : pojoProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream); }