com.fasterxml.jackson.databind
Class ObjectReader

java.lang.Object
  extended by com.fasterxml.jackson.core.ObjectCodec
      extended by com.fasterxml.jackson.databind.ObjectReader
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned

public class ObjectReader
extends com.fasterxml.jackson.core.ObjectCodec
implements com.fasterxml.jackson.core.Versioned

Builder object that can be used for per-serialization configuration of deserialization parameters, such as root type to use or object to update (instead of constructing new instance).

Uses "fluent" (aka builder) pattern so that instances are immutable (and thus fully thread-safe with no external synchronization); new instances are constructed for different configurations. Instances are initially constructed by ObjectMapper and can be reused, shared, cached; both because of thread-safety and because instances are relatively light-weight.


Field Summary
protected  DeserializationConfig _config
          General serialization configuration settings; while immutable, can use copy-constructor to create modified instances as necessary.
protected  DefaultDeserializationContext _context
          Blueprint instance of deserialization context; used for creating actual instance when needed.
protected  InjectableValues _injectableValues
          Values that can be injected during deserialization, if any.
protected  com.fasterxml.jackson.core.JsonFactory _jsonFactory
          Factory used for constructing JsonGenerators
protected  ConcurrentHashMap<JavaType,JsonDeserializer<Object>> _rootDeserializers
          Root-level cached deserializers
protected  RootNameLookup _rootNames
          Cache for root names used when root-wrapping is enabled.
protected  com.fasterxml.jackson.core.FormatSchema _schema
          When using data format that uses a schema, schema is passed to parser.
protected  boolean _unwrapRoot
          Flag that indicates whether root values are expected to be unwrapped or not
protected  Object _valueToUpdate
          Instance to update with data binding; if any.
protected  JavaType _valueType
          Declared type of value to instantiate during deserialization.
 
Constructor Summary
protected ObjectReader(ObjectMapper mapper, DeserializationConfig config)
          Constructor used by ObjectMapper for initial instantiation
protected ObjectReader(ObjectMapper mapper, DeserializationConfig config, JavaType valueType, Object valueToUpdate, com.fasterxml.jackson.core.FormatSchema schema, InjectableValues injectableValues)
           
protected ObjectReader(ObjectReader base, DeserializationConfig config)
          Copy constructor used when modifying simple feature flags
protected ObjectReader(ObjectReader base, DeserializationConfig config, JavaType valueType, Object valueToUpdate, com.fasterxml.jackson.core.FormatSchema schema, InjectableValues injectableValues)
          Copy constructor used for building variations.
 
Method Summary
protected  Object _bind(com.fasterxml.jackson.core.JsonParser jp)
          Actual implementation of value reading+binding operation.
protected  Object _bindAndClose(com.fasterxml.jackson.core.JsonParser jp)
           
protected  JsonNode _bindAndCloseAsTree(com.fasterxml.jackson.core.JsonParser jp)
           
protected  JsonNode _bindAsTree(com.fasterxml.jackson.core.JsonParser jp)
           
protected  JsonDeserializer<Object> _findRootDeserializer(DeserializationContext ctxt, JavaType valueType)
          Method called to locate deserializer for the passed root-level value.
protected static com.fasterxml.jackson.core.JsonToken _initForReading(com.fasterxml.jackson.core.JsonParser jp)
           
protected  Object _unwrapAndDeserialize(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, JavaType rootType, JsonDeserializer<Object> deser)
           
 JsonNode createArrayNode()
           
protected  DefaultDeserializationContext createDeserializationContext(com.fasterxml.jackson.core.JsonParser jp, DeserializationConfig cfg)
          Internal helper method called to create an instance of DeserializationContext for deserializing a single root value.
 JsonNode createObjectNode()
           
 com.fasterxml.jackson.core.JsonFactory getJsonFactory()
           
 TypeFactory getTypeFactory()
           
 boolean isEnabled(DeserializationFeature f)
           
 boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)
           
 boolean isEnabled(MapperFeature f)
           
 JsonNode readTree(InputStream in)
          Method that reads content from given input source, using configuration of this reader, and binds it as JSON Tree.
<T extends com.fasterxml.jackson.core.TreeNode>
T
readTree(com.fasterxml.jackson.core.JsonParser jp)
          Convenience method that binds content read using given parser, using configuration of this reader, except that content is bound as JSON tree instead of configured root value type.
 JsonNode readTree(Reader r)
          Method that reads content from given input source, using configuration of this reader, and binds it as JSON Tree.
 JsonNode readTree(String content)
          Method that reads content from given JSON input String, using configuration of this reader, and binds it as JSON Tree.
<T> T
readValue(byte[] src)
          Method that binds content read from given byte array, using configuration of this reader.
<T> T
readValue(byte[] src, int offset, int length)
          Method that binds content read from given byte array, using configuration of this reader.
<T> T
readValue(File src)
           
<T> T
readValue(InputStream src)
          Method that binds content read from given input source, using configuration of this reader.
<T> T
readValue(JsonNode src)
          Convenience method for converting results from given JSON tree into given value type.
<T> T
readValue(com.fasterxml.jackson.core.JsonParser jp)
          Method that binds content read using given parser, using configuration of this reader, including expected result type.
<T> T
readValue(com.fasterxml.jackson.core.JsonParser jp, Class<T> valueType)
          Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type).
<T> T
readValue(com.fasterxml.jackson.core.JsonParser jp, JavaType valueType)
          Type-safe overloaded method, basically alias for readValue(JsonParser, ResolvedType).
<T> T
readValue(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.core.type.ResolvedType valueType)
          Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type).
<T> T
readValue(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef)
          Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type).
<T> T
readValue(Reader src)
          Method that binds content read from given input source, using configuration of this reader.
<T> T
readValue(String src)
          Method that binds content read from given JSON string, using configuration of this reader.
<T> T
readValue(URL src)
          Method that binds content read from given input source, using configuration of this reader.
<T> MappingIterator<T>
readValues(byte[] src)
           
<T> MappingIterator<T>
readValues(byte[] src, int offset, int length)
          Method for reading sequence of Objects from parser stream.
<T> MappingIterator<T>
readValues(File src)
          Method for reading sequence of Objects from parser stream.
<T> MappingIterator<T>
readValues(InputStream src)
          Method for reading sequence of Objects from parser stream.
<T> MappingIterator<T>
readValues(com.fasterxml.jackson.core.JsonParser jp)
          Method for reading sequence of Objects from parser stream.
<T> Iterator<T>
readValues(com.fasterxml.jackson.core.JsonParser jp, Class<T> valueType)
          Convenience method that is equivalent to:
<T> Iterator<T>
readValues(com.fasterxml.jackson.core.JsonParser jp, JavaType valueType)
          Type-safe overloaded method, basically alias for readValues(JsonParser, ResolvedType).
<T> Iterator<T>
readValues(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.core.type.ResolvedType valueType)
          Convenience method that is equivalent to:
<T> Iterator<T>
readValues(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef)
          Convenience method that is equivalent to:
<T> MappingIterator<T>
readValues(Reader src)
          Method for reading sequence of Objects from parser stream.
<T> MappingIterator<T>
readValues(String json)
          Method for reading sequence of Objects from parser stream.
<T> MappingIterator<T>
readValues(URL src)
          Method for reading sequence of Objects from parser stream.
 com.fasterxml.jackson.core.JsonParser treeAsTokens(com.fasterxml.jackson.core.TreeNode n)
           
<T> T
treeToValue(com.fasterxml.jackson.core.TreeNode n, Class<T> valueType)
           
 com.fasterxml.jackson.core.Version version()
          Method that will return version information stored in and read from jar that contains this class.
 ObjectReader with(DeserializationFeature feature)
          Method for constructing a new reader instance that is configured with specified feature enabled.
 ObjectReader with(DeserializationFeature first, DeserializationFeature... other)
          Method for constructing a new reader instance that is configured with specified features enabled.
 ObjectReader with(com.fasterxml.jackson.core.FormatSchema schema)
          Method for constructing a new instance with configuration that passes specified FormatSchema to JsonParser that is constructed for parsing content.
 ObjectReader with(InjectableValues injectableValues)
          Method for constructing a new instance with configuration that uses passed InjectableValues to provide injectable values.
 ObjectReader with(JsonNodeFactory f)
          Method for constructing a new reader instance with configuration that uses passed JsonNodeFactory for constructing JsonNode instances.
 ObjectReader with(Locale l)
           
 ObjectReader with(TimeZone tz)
           
 ObjectReader withFeatures(DeserializationFeature... features)
          Method for constructing a new reader instance that is configured with specified features enabled.
 ObjectReader without(DeserializationFeature feature)
          Method for constructing a new reader instance that is configured with specified feature disabled.
 ObjectReader without(DeserializationFeature first, DeserializationFeature... other)
          Method for constructing a new reader instance that is configured with specified features disabled.
 ObjectReader withoutFeatures(DeserializationFeature... features)
          Method for constructing a new reader instance that is configured with specified features disabled.
 ObjectReader withRootName(String rootName)
          Method for constructing a new instance with configuration that specifies what root name to expect for "root name unwrapping".
 ObjectReader withType(Class<?> valueType)
          Method for constructing a new reader instance that is configured to data bind into specified type.
 ObjectReader withType(JavaType valueType)
          Method for constructing a new reader instance that is configured to data bind into specified type.
 ObjectReader withType(Type valueType)
          Method for constructing a new reader instance that is configured to data bind into specified type.
 ObjectReader withType(com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef)
          Method for constructing a new reader instance that is configured to data bind into specified type.
 ObjectReader withValueToUpdate(Object value)
          Method for constructing a new instance with configuration that updates passed Object (as root value), instead of constructing a new value.
 ObjectReader withView(Class<?> activeView)
          Method for constructing a new instance with configuration that uses specified View for filtering.
 void writeValue(com.fasterxml.jackson.core.JsonGenerator jgen, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_config

protected final DeserializationConfig _config
General serialization configuration settings; while immutable, can use copy-constructor to create modified instances as necessary.


_context

protected final DefaultDeserializationContext _context
Blueprint instance of deserialization context; used for creating actual instance when needed.


_jsonFactory

protected final com.fasterxml.jackson.core.JsonFactory _jsonFactory
Factory used for constructing JsonGenerators


_unwrapRoot

protected final boolean _unwrapRoot
Flag that indicates whether root values are expected to be unwrapped or not


_valueType

protected final JavaType _valueType
Declared type of value to instantiate during deserialization. Defines which deserializer to use; as well as base type of instance to construct if an updatable value is not configured to be used (subject to changes by embedded type information, for polymorphic types). If _valueToUpdate is non-null, only used for locating deserializer.


_valueToUpdate

protected final Object _valueToUpdate
Instance to update with data binding; if any. If null, a new instance is created, if non-null, properties of this value object will be updated instead. Note that value can be of almost any type, except not ArrayType; array types can not be modified because array size is immutable.


_schema

protected final com.fasterxml.jackson.core.FormatSchema _schema
When using data format that uses a schema, schema is passed to parser.


_injectableValues

protected final InjectableValues _injectableValues
Values that can be injected during deserialization, if any.


_rootDeserializers

protected final ConcurrentHashMap<JavaType,JsonDeserializer<Object>> _rootDeserializers
Root-level cached deserializers


_rootNames

protected final RootNameLookup _rootNames
Cache for root names used when root-wrapping is enabled.

Constructor Detail

ObjectReader

protected ObjectReader(ObjectMapper mapper,
                       DeserializationConfig config)
Constructor used by ObjectMapper for initial instantiation


ObjectReader

protected ObjectReader(ObjectMapper mapper,
                       DeserializationConfig config,
                       JavaType valueType,
                       Object valueToUpdate,
                       com.fasterxml.jackson.core.FormatSchema schema,
                       InjectableValues injectableValues)

ObjectReader

protected ObjectReader(ObjectReader base,
                       DeserializationConfig config,
                       JavaType valueType,
                       Object valueToUpdate,
                       com.fasterxml.jackson.core.FormatSchema schema,
                       InjectableValues injectableValues)
Copy constructor used for building variations.


ObjectReader

protected ObjectReader(ObjectReader base,
                       DeserializationConfig config)
Copy constructor used when modifying simple feature flags

Method Detail

version

public com.fasterxml.jackson.core.Version version()
Method that will return version information stored in and read from jar that contains this class.

Specified by:
version in interface com.fasterxml.jackson.core.Versioned

with

public ObjectReader with(DeserializationFeature feature)
Method for constructing a new reader instance that is configured with specified feature enabled.


with

public ObjectReader with(DeserializationFeature first,
                         DeserializationFeature... other)
Method for constructing a new reader instance that is configured with specified features enabled.


withFeatures

public ObjectReader withFeatures(DeserializationFeature... features)
Method for constructing a new reader instance that is configured with specified features enabled.


without

public ObjectReader without(DeserializationFeature feature)
Method for constructing a new reader instance that is configured with specified feature disabled.


without

public ObjectReader without(DeserializationFeature first,
                            DeserializationFeature... other)
Method for constructing a new reader instance that is configured with specified features disabled.


withoutFeatures

public ObjectReader withoutFeatures(DeserializationFeature... features)
Method for constructing a new reader instance that is configured with specified features disabled.


with

public ObjectReader with(InjectableValues injectableValues)
Method for constructing a new instance with configuration that uses passed InjectableValues to provide injectable values.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


with

public ObjectReader with(JsonNodeFactory f)
Method for constructing a new reader instance with configuration that uses passed JsonNodeFactory for constructing JsonNode instances.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withRootName

public ObjectReader withRootName(String rootName)
Method for constructing a new instance with configuration that specifies what root name to expect for "root name unwrapping". See DeserializationConfig.withRootName(String) for details.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


with

public ObjectReader with(com.fasterxml.jackson.core.FormatSchema schema)
Method for constructing a new instance with configuration that passes specified FormatSchema to JsonParser that is constructed for parsing content.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withType

public ObjectReader withType(JavaType valueType)
Method for constructing a new reader instance that is configured to data bind into specified type.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withType

public ObjectReader withType(Class<?> valueType)
Method for constructing a new reader instance that is configured to data bind into specified type.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withType

public ObjectReader withType(Type valueType)
Method for constructing a new reader instance that is configured to data bind into specified type.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withType

public ObjectReader withType(com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef)
Method for constructing a new reader instance that is configured to data bind into specified type.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withValueToUpdate

public ObjectReader withValueToUpdate(Object value)
Method for constructing a new instance with configuration that updates passed Object (as root value), instead of constructing a new value.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


withView

public ObjectReader withView(Class<?> activeView)
Method for constructing a new instance with configuration that uses specified View for filtering.

Note that the method does NOT change state of this reader, but rather construct and returns a newly configured instance.


with

public ObjectReader with(Locale l)

with

public ObjectReader with(TimeZone tz)

isEnabled

public boolean isEnabled(DeserializationFeature f)

isEnabled

public boolean isEnabled(MapperFeature f)

isEnabled

public boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)

getJsonFactory

public com.fasterxml.jackson.core.JsonFactory getJsonFactory()
Specified by:
getJsonFactory in class com.fasterxml.jackson.core.ObjectCodec

getTypeFactory

public TypeFactory getTypeFactory()

readValue

public <T> T readValue(com.fasterxml.jackson.core.JsonParser jp)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read using given parser, using configuration of this reader, including expected result type. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(com.fasterxml.jackson.core.JsonParser jp,
                       Class<T> valueType)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type). Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Specified by:
readValue in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(com.fasterxml.jackson.core.JsonParser jp,
                       com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type). Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Specified by:
readValue in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(com.fasterxml.jackson.core.JsonParser jp,
                       com.fasterxml.jackson.core.type.ResolvedType valueType)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Convenience method that binds content read using given parser, using configuration of this reader, except that expected value type is specified with the call (instead of currently configured root type). Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Specified by:
readValue in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(com.fasterxml.jackson.core.JsonParser jp,
                       JavaType valueType)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Type-safe overloaded method, basically alias for readValue(JsonParser, ResolvedType).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readTree

public <T extends com.fasterxml.jackson.core.TreeNode> T readTree(com.fasterxml.jackson.core.JsonParser jp)
                                                       throws IOException,
                                                              com.fasterxml.jackson.core.JsonProcessingException
Convenience method that binds content read using given parser, using configuration of this reader, except that content is bound as JSON tree instead of configured root value type.

Note: if an object was specified with withValueToUpdate(java.lang.Object), it will be ignored.

Specified by:
readTree in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser jp,
                                  Class<T> valueType)
                       throws IOException,
                              com.fasterxml.jackson.core.JsonProcessingException
Convenience method that is equivalent to:
   withType(valueType).readValues(jp);

Specified by:
readValues in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser jp,
                                  com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef)
                       throws IOException,
                              com.fasterxml.jackson.core.JsonProcessingException
Convenience method that is equivalent to:
   withType(valueTypeRef).readValues(jp);

Specified by:
readValues in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser jp,
                                  com.fasterxml.jackson.core.type.ResolvedType valueType)
                       throws IOException,
                              com.fasterxml.jackson.core.JsonProcessingException
Convenience method that is equivalent to:
   withType(valueType).readValues(jp);

Specified by:
readValues in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> Iterator<T> readValues(com.fasterxml.jackson.core.JsonParser jp,
                                  JavaType valueType)
                       throws IOException,
                              com.fasterxml.jackson.core.JsonProcessingException
Type-safe overloaded method, basically alias for readValues(JsonParser, ResolvedType).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(InputStream src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read from given input source, using configuration of this reader. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(Reader src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read from given input source, using configuration of this reader. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(String src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read from given JSON string, using configuration of this reader. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(byte[] src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read from given byte array, using configuration of this reader. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(byte[] src,
                       int offset,
                       int length)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read from given byte array, using configuration of this reader. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(File src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(URL src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Method that binds content read from given input source, using configuration of this reader. Value return is either newly constructed, or root value that was specified with withValueToUpdate(Object).

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValue

public <T> T readValue(JsonNode src)
            throws IOException,
                   com.fasterxml.jackson.core.JsonProcessingException
Convenience method for converting results from given JSON tree into given value type. Basically short-cut for:
   objectReader.readValue(src.traverse())

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readTree

public JsonNode readTree(InputStream in)
                  throws IOException,
                         com.fasterxml.jackson.core.JsonProcessingException
Method that reads content from given input source, using configuration of this reader, and binds it as JSON Tree.

Note that if an object was specified with a call to withValueToUpdate(Object) it will just be ignored; result is always a newly constructed JsonNode instance.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readTree

public JsonNode readTree(Reader r)
                  throws IOException,
                         com.fasterxml.jackson.core.JsonProcessingException
Method that reads content from given input source, using configuration of this reader, and binds it as JSON Tree.

Note that if an object was specified with a call to withValueToUpdate(Object) it will just be ignored; result is always a newly constructed JsonNode instance.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readTree

public JsonNode readTree(String content)
                  throws IOException,
                         com.fasterxml.jackson.core.JsonProcessingException
Method that reads content from given JSON input String, using configuration of this reader, and binds it as JSON Tree.

Note that if an object was specified with a call to withValueToUpdate(Object) it will just be ignored; result is always a newly constructed JsonNode instance.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(com.fasterxml.jackson.core.JsonParser jp)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(InputStream src)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(Reader src)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(String json)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(byte[] src,
                                         int offset,
                                         int length)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public final <T> MappingIterator<T> readValues(byte[] src)
                                    throws IOException,
                                           com.fasterxml.jackson.core.JsonProcessingException
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(File src)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

readValues

public <T> MappingIterator<T> readValues(URL src)
                              throws IOException,
                                     com.fasterxml.jackson.core.JsonProcessingException
Method for reading sequence of Objects from parser stream.

Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException

createDeserializationContext

protected final DefaultDeserializationContext createDeserializationContext(com.fasterxml.jackson.core.JsonParser jp,
                                                                           DeserializationConfig cfg)
Internal helper method called to create an instance of DeserializationContext for deserializing a single root value. Can be overridden if a custom context is needed.


_bind

protected Object _bind(com.fasterxml.jackson.core.JsonParser jp)
                throws IOException,
                       com.fasterxml.jackson.core.JsonParseException,
                       JsonMappingException
Actual implementation of value reading+binding operation.

Throws:
IOException
com.fasterxml.jackson.core.JsonParseException
JsonMappingException

_bindAndClose

protected Object _bindAndClose(com.fasterxml.jackson.core.JsonParser jp)
                        throws IOException,
                               com.fasterxml.jackson.core.JsonParseException,
                               JsonMappingException
Throws:
IOException
com.fasterxml.jackson.core.JsonParseException
JsonMappingException

_bindAsTree

protected JsonNode _bindAsTree(com.fasterxml.jackson.core.JsonParser jp)
                        throws IOException,
                               com.fasterxml.jackson.core.JsonParseException,
                               JsonMappingException
Throws:
IOException
com.fasterxml.jackson.core.JsonParseException
JsonMappingException

_bindAndCloseAsTree

protected JsonNode _bindAndCloseAsTree(com.fasterxml.jackson.core.JsonParser jp)
                                throws IOException,
                                       com.fasterxml.jackson.core.JsonParseException,
                                       JsonMappingException
Throws:
IOException
com.fasterxml.jackson.core.JsonParseException
JsonMappingException

_initForReading

protected static com.fasterxml.jackson.core.JsonToken _initForReading(com.fasterxml.jackson.core.JsonParser jp)
                                                               throws IOException,
                                                                      com.fasterxml.jackson.core.JsonParseException,
                                                                      JsonMappingException
Throws:
IOException
com.fasterxml.jackson.core.JsonParseException
JsonMappingException

_findRootDeserializer

protected JsonDeserializer<Object> _findRootDeserializer(DeserializationContext ctxt,
                                                         JavaType valueType)
                                                  throws JsonMappingException
Method called to locate deserializer for the passed root-level value.

Throws:
JsonMappingException

_unwrapAndDeserialize

protected Object _unwrapAndDeserialize(com.fasterxml.jackson.core.JsonParser jp,
                                       DeserializationContext ctxt,
                                       JavaType rootType,
                                       JsonDeserializer<Object> deser)
                                throws IOException,
                                       com.fasterxml.jackson.core.JsonParseException,
                                       JsonMappingException
Throws:
IOException
com.fasterxml.jackson.core.JsonParseException
JsonMappingException

createArrayNode

public JsonNode createArrayNode()
Specified by:
createArrayNode in class com.fasterxml.jackson.core.ObjectCodec

createObjectNode

public JsonNode createObjectNode()
Specified by:
createObjectNode in class com.fasterxml.jackson.core.ObjectCodec

treeAsTokens

public com.fasterxml.jackson.core.JsonParser treeAsTokens(com.fasterxml.jackson.core.TreeNode n)
Specified by:
treeAsTokens in class com.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:
treeToValue in class com.fasterxml.jackson.core.ObjectCodec
Throws:
com.fasterxml.jackson.core.JsonProcessingException

writeValue

public void writeValue(com.fasterxml.jackson.core.JsonGenerator jgen,
                       Object value)
                throws IOException,
                       com.fasterxml.jackson.core.JsonProcessingException
Specified by:
writeValue in class com.fasterxml.jackson.core.ObjectCodec
Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException


Copyright © 2012 fasterxml.com. All Rights Reserved.