JSON that implements ObjectCodec.
Note that implementation is not complete, due to natural limitations of
JSON and "simple" object binding.
The main use case is to give minimal context for other components that
expect to get a ObjectCodec, such as JsonParser and
JsonGenerator.
| Modifier and Type | Field and Description |
|---|---|
| protected final JSON | |
| protected final JsonFactory | |
| protected final TreeCodec |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected TreeCodec | |
| protected JSONObjectException | |
| public TreeNode | createArrayNode()
Implements abstract com. Method for construct root level Array nodes for Tree Model instances. |
| public TreeNode | createObjectNode()
Implements abstract com. Method for construct root level Object nodes for Tree Model instances. |
| public JsonFactory | getFactory()
Overrides com. Accessor for finding underlying data format factory
( |
| public JsonFactory | |
| public TreeNode | |
| public TreeNode | |
| public <T extends TreeNode> T | readTree(JsonParser jp)
Implements abstract com. Method for deserializing JSON content as tree expressed
using set of |
| public <T> T | readValue(JsonParser
Parser to use for decoding content to bind p, Class<T> Java value type to bind content to valueType)Implements abstract com. 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 <T> T | readValue(JsonParser
Parser to use for decoding content to bind p, TypeReference<T> Java value type to bind content to valueTypeRef)Implements abstract com. Method to deserialize JSON content into a Java type, reference to which is passed as argument. |
| public <T> T | readValue(JsonParser
Parser to use for decoding content to bind p, ResolvedType Java value type to bind content to valueType)Implements abstract com. 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 <T> Iterator | readValues(JsonParser
Parser to use for decoding content to bind p, Class<T> Java value type to bind content to valueType)Implements abstract com. Method for reading sequence of Objects from parser stream, all with same specified value type. |
| public <T> Iterator | readValues(JsonParser
Parser to use for decoding content to bind p, TypeReference<T> Java value type to bind content to valueTypeRef)Implements abstract com. Method for reading sequence of Objects from parser stream, all with same specified value type. |
| public <T> Iterator | readValues(JsonParser
Parser to use for decoding content to bind p, ResolvedType Java value type to bind content to valueType)Implements abstract com. Method for reading sequence of Objects from parser stream, all with same specified value type. |
| public JsonParser | treeAsTokens(TreeNode
Content to traverse over n)Implements abstract com. Method for constructing a |
| public <T> T | treeToValue(TreeNode
Tree to convert n, Class<T> Java target value type to convert content to valueType)Implements abstract com. Convenience method for converting given JSON tree into instance of specified value type. |
| public Version | version()
Implements abstract com. Implements 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 |
| public void | writeTree(JsonGenerator
Generator to use for serializing value jg, TreeNode Tree to serialize tree)Implements abstract com. Method for serializing JSON content from given Tree instance, using specified generator. |
| public void | writeValue(JsonGenerator
Generator to use for serializing value jgen, Object Value to serialize value)Implements abstract com. Method to serialize given Java Object, using generator provided. |
| _json | back to summary |
|---|---|
| protected final JSON _json | |
| _jsonFactory | back to summary |
|---|---|
| protected final JsonFactory _jsonFactory | |
| _treeCodec | back to summary |
|---|---|
| protected final TreeCodec _treeCodec | |
| JSONAsObjectCodec | back to summary |
|---|---|
| public JSONAsObjectCodec(JSON json) | |
| JSONAsObjectCodec | back to summary |
|---|---|
| public JSONAsObjectCodec(JSON json, JsonFactory jf) | |
| JSONAsObjectCodec | back to summary |
|---|---|
| public JSONAsObjectCodec(JSON json, JsonFactory jf, TreeCodec treeCodec) | |
| _checkResultType | back to summary |
|---|---|
| protected void _checkResultType(Class<?> valueType, Object ob) throws JSONObjectException | |
| _checkTreeCodec | back to summary |
|---|---|
| protected TreeCodec _checkTreeCodec() | |
| _noTypeReference | back to summary |
|---|---|
| protected JSONObjectException _noTypeReference() | |
| createArrayNode | back to summary |
|---|---|
| public TreeNode createArrayNode() Implements abstract com. Doc from com. Method for construct root level Array nodes for Tree Model instances. | |
| createObjectNode | back to summary |
|---|---|
| public TreeNode createObjectNode() Implements abstract com. Doc from com. Method for construct root level Object nodes for Tree Model instances. | |
| getFactory | back to summary |
|---|---|
| public JsonFactory getFactory() Overrides com. Doc from com. Accessor for finding underlying data format factory
(
| |
| getJsonFactory | back to summary |
|---|---|
| public JsonFactory getJsonFactory() Overrides com. Deprecated
| |
| missingNode | back to summary |
|---|---|
| public TreeNode missingNode() Overrides com.
| |
| nullNode | back to summary |
|---|---|
| public TreeNode nullNode() Overrides com.
| |
| readTree | back to summary |
|---|---|
| public <T extends TreeNode> T readTree(JsonParser jp) throws IOException, JsonProcessingException Implements abstract com. Doc from com. Method for deserializing JSON content as tree expressed
using set of
| |
| readValue | back to summary |
|---|---|
| public <T> T readValue(JsonParser p, Class<T> valueType) throws IOException, JsonProcessingException Implements abstract com. Doc from com. 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 <T> T readValue(JsonParser p, TypeReference<T> valueTypeRef) throws IOException, JsonProcessingException Implements abstract com. Doc from com. 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 <T> T readValue(JsonParser p, ResolvedType valueType) throws IOException, JsonProcessingException Implements abstract com. Doc from com. 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 <T> Iterator Implements abstract com. Doc from com. Method for reading sequence of Objects from parser stream, all with same specified value type.
| |
| readValues | back to summary |
|---|---|
| public <T> Iterator Implements abstract com. Doc from com. Method for reading sequence of Objects from parser stream, all with same specified value type.
| |
| readValues | back to summary |
|---|---|
| public <T> Iterator Implements abstract com. Doc from com. Method for reading sequence of Objects from parser stream, all with same specified value type.
| |
| treeAsTokens | back to summary |
|---|---|
| public JsonParser treeAsTokens(TreeNode n) Implements abstract com. Doc from com. Method for constructing a
| |
| treeToValue | back to summary |
|---|---|
| public <T> T treeToValue(TreeNode n, Class<T> valueType) throws JsonProcessingException Implements abstract com. Doc from com. 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 Version version() Implements abstract com. Implements 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 void writeTree(JsonGenerator jg, TreeNode tree) throws IOException, JsonProcessingException Implements abstract com. Doc from com. Method for serializing JSON content from given Tree instance, using specified generator.
| |
| writeValue | back to summary |
|---|---|
| public void writeValue(JsonGenerator jgen, Object value) throws IOException, JsonProcessingException Implements abstract com. Doc from com. Method to serialize given Java Object, using generator provided.
| |