List of usage examples for com.fasterxml.jackson.core.type TypeReference getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.github.parisoft.resty.utils.JacksonUtils.java
public static <T> T read(String content, TypeReference<T> reference, MediaType contentType) throws IOException { for (ProviderBase<?, ?, ?, ?> provider : DataProcessors.getInstance().values()) { if (provider.isReadable(reference.getClass(), reference.getType(), null, contentType)) { return provider.locateMapper(reference.getClass(), contentType).readValue(content, reference); }/* www . j a v a2 s . c om*/ } throw new IOException(String.format("no processors found for type=%s and Content-Type=%s", reference.getType(), contentType)); }
From source file:com.github.parisoft.resty.utils.JacksonUtils.java
public static <T> T read(HttpEntity entity, TypeReference<T> reference, MediaType contentType) throws IOException { for (ProviderBase<?, ?, ?, ?> provider : DataProcessors.getInstance().values()) { if (provider.isReadable(reference.getClass(), reference.getType(), null, contentType)) { return provider.locateMapper(reference.getClass(), contentType).readValue(entity.getContent(), reference);// w w w . java 2s. c om } } throw new IOException(String.format("no processors found for type=%s and Content-Type=%s", reference.getType(), contentType)); }