public interface ObjectMapper
JsonParserAndMapper
and JsonSerializer
for implementing actual reading/writing of JSON.
Modifier and Type | Method and Description |
---|---|
Object |
fromJson(byte[] bytes) |
<T> T |
fromJson(byte[] bytes,
Class<T> clazz) |
Object |
fromJson(char[] chars) |
<T> T |
fromJson(char[] chars,
Class<T> clazz) |
Object |
fromJson(InputStream reader) |
<T> T |
fromJson(InputStream reader,
Class<T> clazz) |
Object |
fromJson(Reader reader) |
<T> T |
fromJson(Reader reader,
Class<T> clazz) |
Object |
fromJson(String json) |
<T> T |
fromJson(String json,
Class<T> clazz) |
JsonParserAndMapper |
parser() |
<T extends Collection<C>,C> |
readValue(byte[] src,
Charset charset,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T> T |
readValue(byte[] src,
Class<T> valueType)
Method to deserialize JSON content into a non-container
type typically a bean or wrapper type.
|
<T extends Collection<C>,C> |
readValue(byte[] src,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T> T |
readValue(char[] src,
Class<T> valueType)
Method to deserialize JSON content into a non-container
type typically a bean or wrapper type.
|
<T extends Collection<C>,C> |
readValue(char[] src,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T> T |
readValue(File src,
Class<T> valueType)
Method to deserialize JSON content into a non-container
type typically a bean or wrapper type.
|
<T extends Collection<C>,C> |
readValue(File src,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T extends Collection<C>,C> |
readValue(InputStream src,
Charset charset,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T> T |
readValue(InputStream src,
Class<T> valueType)
Method to deserialize JSON content into a non-container
type typically a bean or wrapper type.
|
<T extends Collection<C>,C> |
readValue(InputStream src,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T> T |
readValue(Reader src,
Class<T> valueType)
Method to deserialize JSON content into a non-container
type typically a bean or wrapper type.
|
<T extends Collection<C>,C> |
readValue(Reader src,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
<T> T |
readValue(String src,
Class<T> valueType)
Method to deserialize JSON content into a non-container
type typically a bean or wrapper type.
|
<T extends Collection<C>,C> |
readValue(String src,
Class<T> valueType,
Class<C> componentType)
Method to deserialize JSON content into a container like Set or List.
|
JsonSerializer |
serializer() |
String |
toJson(Object value) |
void |
toJson(Object value,
Appendable appendable) |
void |
writeValue(File dest,
Object value)
Method that can be used to serialize any Java value as
JSON output, written to File provided.
|
void |
writeValue(OutputStream dest,
Object value)
Method that can be used to serialize any Java value as
JSON output, using output stream provided (using encoding
UTF8.
|
void |
writeValue(Writer dest,
Object value)
Method that can be used to serialize any Java value as
JSON output, using Writer provided.
|
byte[] |
writeValueAsBytes(Object value)
Method that can be used to serialize any Java value as
a byte array.
|
byte[] |
writeValueAsBytes(Object value,
Charset charset)
Method that can be used to serialize any Java value as
a byte array.
|
char[] |
writeValueAsCharArray(Object value)
Method that can be used to serialize any Java value as
a char[].
|
String |
writeValueAsString(Object value)
Method that can be used to serialize any Java value as
a String.
|
<T> T readValue(String src, Class<T> valueType)
Note: this method should NOT be used if the result type is a
container (Collection
or Map
.
The reason is that due to type erasure, key and value types
can not be introspected when using this method.
<T> T readValue(File src, Class<T> valueType)
Note: this method should NOT be used if the result type is a
container (Collection
or Map
.
The reason is that due to type erasure, key and value types
can not be introspected when using this method.
<T> T readValue(byte[] src, Class<T> valueType)
Note: this method should NOT be used if the result type is a
container (Collection
or Map
.
The reason is that due to type erasure, key and value types
can not be introspected when using this method.
<T> T readValue(char[] src, Class<T> valueType)
Note: this method should NOT be used if the result type is a
container (Collection
or Map
.
The reason is that due to type erasure, key and value types
can not be introspected when using this method.
<T> T readValue(Reader src, Class<T> valueType)
Note: this method should NOT be used if the result type is a
container (Collection
or Map
.
The reason is that due to type erasure, key and value types
can not be introspected when using this method.
<T> T readValue(InputStream src, Class<T> valueType)
Note: this method should NOT be used if the result type is a
container (Collection
or Map
.
The reason is that due to type erasure, key and value types
can not be introspected when using this method.
<T extends Collection<C>,C> T readValue(String src, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(File src, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(byte[] src, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(char[] src, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(Reader src, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(InputStream src, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(byte[] src, Charset charset, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
<T extends Collection<C>,C> T readValue(InputStream src, Charset charset, Class<T> valueType, Class<C> componentType)
Note: this method should be used if the result type is a
container (Collection
.
The reason is that due to type erasure, key and value types
can not be introspected without using this method.
void writeValue(File dest, Object value)
void writeValue(OutputStream dest, Object value)
Note: method does not close the underlying stream explicitly here.
void writeValue(Writer dest, Object value)
Note: method does not close the underlying stream explicitly here.
String writeValueAsString(Object value)
writeValue(Writer,Object)
with StringWriter
and constructing String, but more efficient.
char[] writeValueAsCharArray(Object value)
writeValue(Writer,Object)
with StringWriter
and constructing String, but more efficient.
byte[] writeValueAsBytes(Object value)
byte[] writeValueAsBytes(Object value, Charset charset)
JsonParserAndMapper parser()
JsonSerializer serializer()
void toJson(Object value, Appendable appendable)
<T> T fromJson(byte[] bytes, Class<T> clazz)
<T> T fromJson(char[] chars, Class<T> clazz)
<T> T fromJson(InputStream reader, Class<T> clazz)
Object fromJson(byte[] bytes)
Object fromJson(char[] chars)
Object fromJson(InputStream reader)
Copyright © 2014. All rights reserved.