Package 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:
com.fasterxml.jackson.core.Versioned
public class JSONAsObjectCodec
extends com.fasterxml.jackson.core.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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JSONprotected final com.fasterxml.jackson.core.JsonFactoryprotected final com.fasterxml.jackson.core.TreeCodec -
Constructor Summary
ConstructorsConstructorDescriptionJSONAsObjectCodec(JSON json) JSONAsObjectCodec(JSON json, com.fasterxml.jackson.core.JsonFactory jf) JSONAsObjectCodec(JSON json, com.fasterxml.jackson.core.JsonFactory jf, com.fasterxml.jackson.core.TreeCodec treeCodec) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_checkResultType(Class<?> valueType, Object ob) protected com.fasterxml.jackson.core.TreeCodecprotected JSONObjectExceptioncom.fasterxml.jackson.core.TreeNodecom.fasterxml.jackson.core.TreeNodecom.fasterxml.jackson.core.JsonFactorycom.fasterxml.jackson.core.JsonFactoryDeprecated.com.fasterxml.jackson.core.TreeNodecom.fasterxml.jackson.core.TreeNodenullNode()<T extends com.fasterxml.jackson.core.TreeNode>
TreadTree(com.fasterxml.jackson.core.JsonParser jp) <T> TreadValue(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.ResolvedType valueType) <T> TreadValue(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) <T> T<T> Iterator<T>readValues(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.ResolvedType valueType) <T> Iterator<T>readValues(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) <T> Iterator<T>readValues(com.fasterxml.jackson.core.JsonParser p, Class<T> valueType) com.fasterxml.jackson.core.JsonParsertreeAsTokens(com.fasterxml.jackson.core.TreeNode n) <T> TtreeToValue(com.fasterxml.jackson.core.TreeNode n, Class<T> valueType) com.fasterxml.jackson.core.Versionversion()voidwriteTree(com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.core.TreeNode tree) voidwriteValue(com.fasterxml.jackson.core.JsonGenerator jgen, Object value)
-
Field Details
-
_json
-
_jsonFactory
protected final com.fasterxml.jackson.core.JsonFactory _jsonFactory -
_treeCodec
protected final com.fasterxml.jackson.core.TreeCodec _treeCodec
-
-
Constructor Details
-
JSONAsObjectCodec
-
JSONAsObjectCodec
-
JSONAsObjectCodec
public JSONAsObjectCodec(JSON json, com.fasterxml.jackson.core.JsonFactory jf, com.fasterxml.jackson.core.TreeCodec treeCodec)
-
-
Method Details
-
version
public com.fasterxml.jackson.core.Version version()- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Specified by:
versionin classcom.fasterxml.jackson.core.ObjectCodec
-
readValue
public <T> T readValue(com.fasterxml.jackson.core.JsonParser p, Class<T> valueType) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readValuein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
readValue
public <T> T readValue(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readValuein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
readValue
public <T> T readValue(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.ResolvedType valueType) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readValuein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
readValues
public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser p, Class<T> valueType) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readValuesin classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
readValues
public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readValuesin classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
readValues
public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.core.type.ResolvedType valueType) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readValuesin classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
_noTypeReference
-
writeValue
public void writeValue(com.fasterxml.jackson.core.JsonGenerator jgen, Object value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
writeValuein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
createObjectNode
public com.fasterxml.jackson.core.TreeNode createObjectNode()- Specified by:
createObjectNodein classcom.fasterxml.jackson.core.ObjectCodec
-
createArrayNode
public com.fasterxml.jackson.core.TreeNode createArrayNode()- Specified by:
createArrayNodein classcom.fasterxml.jackson.core.ObjectCodec
-
missingNode
public com.fasterxml.jackson.core.TreeNode missingNode()- Overrides:
missingNodein classcom.fasterxml.jackson.core.TreeCodec
-
nullNode
public com.fasterxml.jackson.core.TreeNode nullNode()- Overrides:
nullNodein classcom.fasterxml.jackson.core.TreeCodec
-
readTree
public <T extends com.fasterxml.jackson.core.TreeNode> T readTree(com.fasterxml.jackson.core.JsonParser jp) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
readTreein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
writeTree
public void writeTree(com.fasterxml.jackson.core.JsonGenerator jg, com.fasterxml.jackson.core.TreeNode tree) throws IOException, com.fasterxml.jackson.core.JsonProcessingException - Specified by:
writeTreein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
IOExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
treeAsTokens
public com.fasterxml.jackson.core.JsonParser treeAsTokens(com.fasterxml.jackson.core.TreeNode n) - Specified by:
treeAsTokensin classcom.fasterxml.jackson.core.ObjectCodec
-
treeToValue
public <T> T treeToValue(com.fasterxml.jackson.core.TreeNode n, Class<T> valueType) throws com.fasterxml.jackson.core.JsonProcessingException - Specified by:
treeToValuein classcom.fasterxml.jackson.core.ObjectCodec- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getFactory
public com.fasterxml.jackson.core.JsonFactory getFactory()- Overrides:
getFactoryin classcom.fasterxml.jackson.core.ObjectCodec
-
getJsonFactory
Deprecated.- Overrides:
getJsonFactoryin classcom.fasterxml.jackson.core.ObjectCodec
-
_checkTreeCodec
protected com.fasterxml.jackson.core.TreeCodec _checkTreeCodec() -
_checkResultType
- Throws:
JSONObjectException
-