Uses of Class
com.fasterxml.jackson.core.type.TypeReference
Packages that use TypeReference
Package
Description
Main public API classes of the core streaming JSON
processor: most importantly
JsonFactory
used for constructing
JSON parser (JsonParser)
and generator
(JsonGenerator)
instances.Contains classes needed for type introspection, mostly used by data binding
functionality.
Basic data binding (mapping) functionality that
allows for reading JSON content into Java Objects (POJOs)
and JSON Trees (
JsonNode), as well as
writing Java Objects and trees as JSON.Package that contains most of configuration-related classes;
exception being couple of most-commonly used configuration
things (like Feature enumerations) that are at the
main level (
com.fasterxml.jackson.databind).-
Uses of TypeReference in com.fasterxml.jackson.core
Methods in com.fasterxml.jackson.core with parameters of type TypeReferenceModifier and TypeMethodDescriptionabstract <T> TObjectCodec.readValue(JsonParser p, TypeReference<T> valueTypeRef) Method to deserialize JSON content into a Java type, reference to which is passed as argument.<T> TJsonParser.readValueAs(TypeReference<?> valueTypeRef) Method to deserialize JSON content into a Java type, reference to which is passed as argument.abstract <T> Iterator<T>ObjectCodec.readValues(JsonParser p, TypeReference<T> valueTypeRef) Method for reading sequence of Objects from parser stream, all with same specified value type.<T> Iterator<T>JsonParser.readValuesAs(TypeReference<T> valueTypeRef) Method for reading sequence of Objects from parser stream, all with same specified value type. -
Uses of TypeReference in com.fasterxml.jackson.core.type
Methods in com.fasterxml.jackson.core.type with parameters of type TypeReferenceModifier and TypeMethodDescriptionintTypeReference.compareTo(TypeReference<T> o) The only reason we define this method (and require implementation ofComparable) is to prevent constructing a reference without type information. -
Uses of TypeReference in com.fasterxml.jackson.databind
Methods in com.fasterxml.jackson.databind with parameters of type TypeReferenceModifier and TypeMethodDescriptionObjectMapper.constructType(TypeReference<?> typeRef) Convenience method for constructingJavaTypeout of given type reference.<T> TObjectMapper.convertValue(Object fromValue, TypeReference<T> toValueTypeRef) ObjectReader.forType(TypeReference<?> valueTypeRef) Method for constructing a new reader instance that is configured to data bind into specified type.ObjectWriter.forType(TypeReference<?> rootType) Method that will construct a new instance that uses specific type as the root type for serialization, instead of runtime dynamic type of the root object itself.ObjectMapper.reader(TypeReference<?> type) Deprecated.ObjectMapper.readerFor(TypeReference<?> typeRef) Factory method for constructingObjectReaderthat will read or update instances of specified type<T> TObjectMapper.readValue(byte[] src, int offset, int len, TypeReference<T> valueTypeRef) <T> TObjectMapper.readValue(byte[] src, TypeReference<T> valueTypeRef) <T> TObjectMapper.readValue(JsonParser p, TypeReference<T> valueTypeRef) Method to deserialize JSON content into a Java type, reference to which is passed as argument.<T> TObjectMapper.readValue(File src, TypeReference<T> valueTypeRef) Method to deserialize JSON content from given file into given Java type.<T> TObjectMapper.readValue(InputStream src, TypeReference<T> valueTypeRef) <T> TObjectMapper.readValue(Reader src, TypeReference<T> valueTypeRef) <T> TObjectMapper.readValue(String content, TypeReference<T> valueTypeRef) Method to deserialize JSON content from given JSON content String.<T> TObjectMapper.readValue(URL src, TypeReference<T> valueTypeRef) Same asObjectMapper.readValue(java.net.URL, Class)except that target specified byTypeReference.<T> TObjectReader.readValue(JsonParser p, TypeReference<T> valueTypeRef) Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type).<T> MappingIterator<T>ObjectMapper.readValues(JsonParser p, TypeReference<T> valueTypeRef) Method for reading sequence of Objects from parser stream.<T> Iterator<T>ObjectReader.readValues(JsonParser p, TypeReference<T> valueTypeRef) Convenience method that is equivalent to:<T> TObjectMapper.treeToValue(TreeNode n, TypeReference<T> toValueTypeRef) Same asObjectMapper.treeToValue(TreeNode, JavaType)but target type specified using fully resolvedTypeReference.ObjectReader.withType(TypeReference<?> valueTypeRef) Deprecated.since 2.5 UseObjectReader.forType(TypeReference)insteadObjectWriter.withType(TypeReference<?> rootType) Deprecated.since 2.5 UseObjectWriter.forType(TypeReference)insteadObjectMapper.writerFor(TypeReference<?> rootType) Factory method for constructingObjectWriterthat will serialize objects using specified root type, instead of actual runtime type of value.ObjectMapper.writerWithType(TypeReference<?> rootType) Deprecated.Since 2.5, useObjectMapper.writerFor(TypeReference)instead -
Uses of TypeReference in com.fasterxml.jackson.databind.cfg
Methods in com.fasterxml.jackson.databind.cfg with parameters of type TypeReferenceModifier and TypeMethodDescriptionfinal JavaTypeMapperConfig.constructType(TypeReference<?> valueTypeRef) Helper method that will constructJavaTypefor given type reference This is a simple short-cut for: -
Uses of TypeReference in com.fasterxml.jackson.databind.type
Methods in com.fasterxml.jackson.databind.type with parameters of type TypeReference
ObjectMapper.readerFor(TypeReference)instead