JsonParser and
JsonGenerator use to serialize and deserialize regular
Java objects (POJOs aka Beans).
The standard implementation of this class is
com.fasterxml.jackson.databind.ObjectMapper,
defined in the "jackson-databind".
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract TreeNode | Returns: Array node createdImplements abstract com. |
| public abstract TreeNode | Returns: Object node createdImplements abstract com. |
| public JsonFactory | Returns: UnderlyingJsonFactory instanceAccessor for finding underlying data format factory
( |
| public JsonFactory | |
| public abstract <T extends TreeNode> T | Returns: next tree fromp, or null if empty.Implements abstract com. TreeNode instances.
|
| public abstract < Nominal parameter for target type T> T | Returns: Value deserializedParser to use for decoding content to bind p, Class<T> Java value type to bind content to valueType)Method to deserialize JSON content into a non-container
type (it can be an array type, however): typically a bean, array
or a wrapper type (like |
| public abstract < Nominal parameter for target type T> T | Returns: Value deserializedParser to use for decoding content to bind p, TypeReference<T> Java value type to bind content to valueTypeRef)Method to deserialize JSON content into a Java type, reference to which is passed as argument. |
| public abstract < Nominal parameter for target type T> T | Returns: Value deserializedParser to use for decoding content to bind p, ResolvedType Java value type to bind content to valueType)Method to deserialize JSON content into a POJO, type specified
with fully resolved type object (so it can be a generic type,
including containers like |
| public abstract < Nominal parameter for target type T> Iterator | Returns: Iterator for incrementally deserializing valuesParser to use for decoding content to bind p, Class<T> Java value type to bind content to valueType)Method for reading sequence of Objects from parser stream, all with same specified value type. |
| public abstract < Nominal parameter for target type T> Iterator | Returns: Iterator for incrementally deserializing valuesParser to use for decoding content to bind p, TypeReference<T> Java value type to bind content to valueTypeRef)Method for reading sequence of Objects from parser stream, all with same specified value type. |
| public abstract < Nominal parameter for target type T> Iterator | Returns: Iterator for incrementally deserializing valuesParser to use for decoding content to bind p, ResolvedType Java value type to bind content to valueType)Method for reading sequence of Objects from parser stream, all with same specified value type. |
| public abstract JsonParser | Returns: Parser constructed for traversing over contents of specified nodeContent to traverse over n)Implements abstract com. JsonParser for reading
contents of a JSON tree, as if it was external serialized
JSON content.
|
| public abstract < Nominal parameter for target type T> T | Returns: Converted value instanceTree to convert n, Class<T> Java target value type to convert content to valueType)Convenience method for converting given JSON tree into instance of specified value type. |
| public abstract Version | version()
Redeclares com. Version for details).
|
| public abstract void | writeTree(JsonGenerator
Generator to use for serializing value gen, TreeNode Tree to serialize tree)Implements abstract com. |
| public abstract void | writeValue(JsonGenerator
Generator to use for serializing value gen, Object Value to serialize value)Method to serialize given Java Object, using generator provided. |
| ObjectCodec | back to summary |
|---|---|
| protected ObjectCodec() | |
| createArrayNode | back to summary |
|---|---|
| public abstract TreeNode createArrayNode() Implements abstract com. Method for construct root level Array nodes for Tree Model instances. | |
| createObjectNode | back to summary |
|---|---|
| public abstract TreeNode createObjectNode() Implements abstract com. Method for construct root level Object nodes for Tree Model instances. | |
| getFactory | back to summary |
|---|---|
| public JsonFactory getFactory() Accessor for finding underlying data format factory
(
| |
| getJsonFactory | back to summary |
|---|---|
| public JsonFactory getJsonFactory()
Deprecated Use
| |
| readTree | back to summary |
|---|---|
| public abstract <T extends TreeNode> T readTree(JsonParser p) throws IOException Implements abstract com. Method for deserializing JSON content as tree expressed
using set of
| |
| readValue | back to summary |
|---|---|
| public abstract <T> T readValue(JsonParser p, Class<T> valueType) throws IOException Method to deserialize JSON content into a non-container
type (it can be an array type, however): typically a bean, array
or a wrapper type (like Note this method should NOT be used if the result type is a
container (
| |
| readValue | back to summary |
|---|---|
| public abstract <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef) throws IOException Method to deserialize JSON content into a Java type, reference to which is passed as argument. Type is passed using so-called "super type token" and specifically needs to be used if the root type is a parameterized (generic) container type.
| |
| readValue | back to summary |
|---|---|
| public abstract <T> T readValue(JsonParser p, ResolvedType valueType) throws IOException Method to deserialize JSON content into a POJO, type specified
with fully resolved type object (so it can be a generic type,
including containers like
| |
| readValues | back to summary |
|---|---|
| public abstract <T> Iterator Method for reading sequence of Objects from parser stream, all with same specified value type.
| |
| readValues | back to summary |
|---|---|
| public abstract <T> Iterator Method for reading sequence of Objects from parser stream, all with same specified value type.
| |
| readValues | back to summary |
|---|---|
| public abstract <T> Iterator Method for reading sequence of Objects from parser stream, all with same specified value type.
| |
| treeAsTokens | back to summary |
|---|---|
| public abstract JsonParser treeAsTokens(TreeNode n) Implements abstract com. Method for constructing a
| |
| treeToValue | back to summary |
|---|---|
| public abstract <T> T treeToValue(TreeNode n, Class<T> valueType) throws JsonProcessingException Convenience method for converting given JSON tree into instance of specified
value type. This is equivalent to first constructing a
| |
| version | back to summary |
|---|---|
| public abstract Version version() Redeclares com. Doc from com. Method called to detect version of the component that implements this interface;
returned version should never be null, but may return specific "not available"
instance (see | |
| writeTree | back to summary |
|---|---|
| public abstract void writeTree(JsonGenerator gen, TreeNode tree) throws IOException Implements abstract com. Method for serializing JSON content from given Tree instance, using specified generator.
| |
| writeValue | back to summary |
|---|---|
| public abstract void writeValue(JsonGenerator gen, Object value) throws IOException Method to serialize given Java Object, using generator provided.
| |