com.fasterxml.jackson.jr.ob.impl
Class JSONAsObjectCodec
java.lang.Object
com.fasterxml.jackson.core.TreeCodec
com.fasterxml.jackson.core.ObjectCodec
com.fasterxml.jackson.jr.ob.impl.JSONAsObjectCodec
- All Implemented Interfaces:
- Versioned
public class JSONAsObjectCodec
- extends ObjectCodec
Convenience wrapper around 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
.
Method Summary |
protected void |
_checkResultType(Class<?> valueType,
Object ob)
|
protected TreeCodec |
_checkTreeCodec()
|
protected JSONObjectException |
_noTypeReference()
|
TreeNode |
createArrayNode()
|
TreeNode |
createObjectNode()
|
JsonFactory |
getFactory()
|
JsonFactory |
getJsonFactory()
Deprecated. |
|
readTree(JsonParser jp)
|
|
readValue(JsonParser jp,
Class<T> valueType)
|
|
readValue(JsonParser jp,
ResolvedType valueType)
|
|
readValue(JsonParser jp,
TypeReference<?> valueTypeRef)
|
|
readValues(JsonParser jp,
Class<T> valueType)
|
|
readValues(JsonParser jp,
ResolvedType valueType)
|
|
readValues(JsonParser jp,
TypeReference<?> valueTypeRef)
|
JsonParser |
treeAsTokens(TreeNode n)
|
|
treeToValue(TreeNode n,
Class<T> valueType)
|
void |
writeTree(JsonGenerator jg,
TreeNode tree)
|
void |
writeValue(JsonGenerator jgen,
Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_json
protected final JSON _json
_jsonFactory
protected final JsonFactory _jsonFactory
_treeCodec
protected final TreeCodec _treeCodec
JSONAsObjectCodec
public JSONAsObjectCodec(JSON json)
JSONAsObjectCodec
public JSONAsObjectCodec(JSON json,
JsonFactory jf)
JSONAsObjectCodec
public JSONAsObjectCodec(JSON json,
JsonFactory jf,
TreeCodec treeCodec)
readValue
public <T> T readValue(JsonParser jp,
Class<T> valueType)
throws IOException,
JsonProcessingException
- Specified by:
readValue
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
readValue
public <T> T readValue(JsonParser jp,
TypeReference<?> valueTypeRef)
throws IOException,
JsonProcessingException
- Specified by:
readValue
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
readValue
public <T> T readValue(JsonParser jp,
ResolvedType valueType)
throws IOException,
JsonProcessingException
- Specified by:
readValue
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
readValues
public <T> Iterator<T> readValues(JsonParser jp,
Class<T> valueType)
throws IOException,
JsonProcessingException
- Specified by:
readValues
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
readValues
public <T> Iterator<T> readValues(JsonParser jp,
TypeReference<?> valueTypeRef)
throws IOException,
JsonProcessingException
- Specified by:
readValues
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
readValues
public <T> Iterator<T> readValues(JsonParser jp,
ResolvedType valueType)
throws IOException,
JsonProcessingException
- Specified by:
readValues
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
_noTypeReference
protected JSONObjectException _noTypeReference()
writeValue
public void writeValue(JsonGenerator jgen,
Object value)
throws IOException,
JsonProcessingException
- Specified by:
writeValue
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
createObjectNode
public TreeNode createObjectNode()
- Specified by:
createObjectNode
in class ObjectCodec
createArrayNode
public TreeNode createArrayNode()
- Specified by:
createArrayNode
in class ObjectCodec
readTree
public <T extends TreeNode> T readTree(JsonParser jp)
throws IOException,
JsonProcessingException
- Specified by:
readTree
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
writeTree
public void writeTree(JsonGenerator jg,
TreeNode tree)
throws IOException,
JsonProcessingException
- Specified by:
writeTree
in class ObjectCodec
- Throws:
IOException
JsonProcessingException
treeAsTokens
public JsonParser treeAsTokens(TreeNode n)
- Specified by:
treeAsTokens
in class ObjectCodec
treeToValue
public <T> T treeToValue(TreeNode n,
Class<T> valueType)
throws JsonProcessingException
- Specified by:
treeToValue
in class ObjectCodec
- Throws:
JsonProcessingException
getFactory
public JsonFactory getFactory()
- Overrides:
getFactory
in class ObjectCodec
getJsonFactory
@Deprecated
public JsonFactory getJsonFactory()
- Deprecated.
- Overrides:
getJsonFactory
in class ObjectCodec
_checkTreeCodec
protected TreeCodec _checkTreeCodec()
_checkResultType
protected void _checkResultType(Class<?> valueType,
Object ob)
throws JSONObjectException
- Throws:
JSONObjectException
Copyright © 2016 FasterXML. All rights reserved.