Uses "mutant factory" 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.
Note
this class is NOT meant as sub-classable by users. It is left as non-final mostly to allow frameworks that require byte code generation for proxying and similar use cases, but there is no expectation that functionality should be extended by sub-classing.
| Modifier and Type | Field and Description |
|---|---|
| protected final DeserializationConfig | _config
General serialization configuration settings; while immutable, can use copy-constructor to create modified instances as necessary. |
| protected final DeserializationContexts | _contexts
Blueprint instance of deserialization context; used for creating actual instance when needed. |
| private final TokenFilter | _filter
Filter to be consider for JsonParser. |
| protected final InjectableValues | _injectableValues
Values that can be injected during deserialization, if any. |
| protected final TokenStreamFactory | _parserFactory
Factory used for constructing |
| protected final ValueDeserializer | _rootDeserializer
We may pre-fetch deserializer as soon as |
| protected final ConcurrentHashMap | _rootDeserializers
Root-level cached deserializers. |
| protected final FormatSchema | _schema
When using data format that uses a schema, schema is passed to parser. |
| protected final boolean | _unwrapRoot
Flag that indicates whether root values are expected to be unwrapped or not |
| protected final Object | _valueToUpdate
Instance to update with data binding; if any. |
| protected final JavaType | _valueType
Declared type of value to instantiate during deserialization. |
| protected static final JavaType |
| Access | Constructor and Description |
|---|---|
| protected | ObjectReader(ObjectMapper mapper, DeserializationConfig config)
Constructor used by |
| protected | ObjectReader(ObjectMapper mapper, DeserializationConfig config, JavaType valueType, Object valueToUpdate, FormatSchema schema, InjectableValues injectableValues)
Constructor called when a root deserializer should be fetched based on other configuration. |
| protected | ObjectReader(ObjectReader base, DeserializationConfig config, JavaType valueType, ValueDeserializer<Object> rootDeser, Object valueToUpdate, FormatSchema schema, InjectableValues injectableValues)
Copy constructor used for building variations. |
| protected | ObjectReader(ObjectReader base, DeserializationConfig config)
Copy constructor used when modifying simple feature flags |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | |
| protected Object | _bind(DeserializationContextExt ctxt, JsonParser p, Object valueToUpdate)
Actual implementation of value reading+binding operation. |
| protected Object | |
| protected final JsonNode | |
| protected <T> MappingIterator | |
| protected final JsonNode | |
| protected final JsonNode | _bindAsTreeOrNull(DeserializationContextExt ctxt, JsonParser p)
Same as |
| protected JsonParser | |
| protected DeserializationContextExt | _deserializationContext()
Internal helper method called to create an instance of |
| protected DeserializationContextExt | |
| protected ValueDeserializer | _findRootDeserializer(DeserializationContext ctxt)
Method called to locate deserializer for the passed root-level value. |
| protected ValueDeserializer | |
| protected void | _initForMultiRead(DeserializationContextExt ctxt, JsonParser p)
Alternative to |
| protected JsonToken | |
| protected InputStream | |
| protected InputStream | |
| protected ObjectReader | _new(ObjectReader base, DeserializationConfig config)
Factory method called by various "withXxx()" methods |
| protected ObjectReader | _new(ObjectReader base, DeserializationConfig config, JavaType valueType, ValueDeserializer<Object> rootDeser, Object valueToUpdate, FormatSchema schema, InjectableValues injectableValues)
Factory method called by various "withXxx()" methods |
| protected <T> MappingIterator | _newIterator(JsonParser p, DeserializationContext ctxt, ValueDeserializer<?> deser, boolean parserManaged)
Factory method used to create |
| protected ValueDeserializer | _prefetchRootDeserializer(JavaType valueType)
Method called to locate deserializer ahead of time, if permitted by configuration. |
| protected final void | |
| protected void | |
| protected final ObjectReader | |
| public ObjectReader | |
| public ObjectReader | at(JsonPointer pointer)
Convenience method to bind from |
| public JsonNode | |
| public ArrayNode | |
| public JsonParser | createNonBlockingByteArrayParser()
Factory method for constructing non-blocking |
| public JsonParser | createNonBlockingByteBufferParser()
Factory method for constructing non-blocking |
| public ObjectNode | |
| public JsonParser | createParser(File src)
Factory method for constructing |
| public JsonParser | createParser(Path src)
Factory method for constructing |
| public JsonParser | createParser(InputStream src)
Factory method for constructing |
| public JsonParser | createParser(Reader src)
Factory method for constructing |
| public JsonParser | createParser(byte[] content)
Factory method for constructing |
| public JsonParser | createParser(byte[] content, int offset, int len)
Factory method for constructing |
| public JsonParser | createParser(String content)
Factory method for constructing |
| public JsonParser | createParser(char[] content)
Factory method for constructing |
| public JsonParser | createParser(char[] content, int offset, int len)
Factory method for constructing |
| public JsonParser | createParser(DataInput content)
Factory method for constructing |
| public ObjectReader | |
| public ObjectReader | |
| public ObjectReader | forType(TypeReference<?> valueTypeRef)
Method for constructing a new reader instance that is configured to data bind into specified type. |
| public ContextAttributes | |
| public DeserializationConfig | |
| public InjectableValues | |
| public TypeFactory | |
| public JavaType | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public JsonNode | |
| public JsonNode | |
| public TokenStreamFactory | |
| public JsonNode | readTree(JsonParser p)
Implements tools. 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. |
| public JsonNode | readTree(InputStream src)
Method that reads content from given input source, using configuration of this reader, and binds it as JSON Tree. |
| public JsonNode | |
| public JsonNode | |
| public JsonNode | readTree(byte[] content)
Same as |
| public JsonNode | readTree(byte[] content, int offset, int len)
Same as |
| public JsonNode | readTree(DataInput content)
Same as |
| public JsonNode | readTree(TokenBuffer src)
Same as |
| public <T> T | readValue(JsonParser p)
Method that binds content read using given parser, using configuration of this reader, including expected result type. |
| public <T> T | readValue(InputStream in)
Method that binds content read from given input source, using configuration of this reader. |
| public <T> T | |
| public <T> T | |
| public <T> T | readValue(byte[]
Byte array that contains encoded content to read content)Method that binds content read from given byte array, using configuration of this reader. |
| public <T> T | readValue(byte[]
Byte array that contains encoded content to read buffer, int Offset of the first content byte in offset, int bufferLength of content in length)buffer, in bytesMethod that binds content read from given byte array, using configuration of this reader. |
| public <T> T | |
| public <T> T | |
| public <T> T | |
| public <T> T | |
| public <T> T | readValue(TokenBuffer
TokenBuffer that contains content to readMethod that binds content read from given |
| public <T> Iterator | readValues(JsonParser p, Class<T> valueType)
Convenience method that is equivalent to: withType(valueType).readValues(p); |
| public <T> Iterator | readValues(JsonParser p, TypeReference<T> valueTypeRef)
Convenience method that is equivalent to: withType(valueTypeRef).readValues(p); |
| public <T> Iterator | readValues(JsonParser p, ResolvedType valueType)
Convenience method that is equivalent to: withType(valueType).readValues(p); |
| public <T> Iterator | readValues(JsonParser p, JavaType valueType)
Convenience method that is equivalent to: withType(valueType).readValues(p); |
| public <T> MappingIterator | |
| public <T> MappingIterator | |
| public <T> MappingIterator | |
| public <T> MappingIterator | readValues(String
String that contains JSON content to parse content)Overloaded version of |
| public <T> MappingIterator | |
| public final <T> MappingIterator | |
| public <T> MappingIterator | |
| public <T> MappingIterator | |
| public <T> MappingIterator | |
| public <T> MappingIterator | |
| public JsonNode | |
| public JsonParser | |
| protected JsonParser | |
| public <T> T | |
| public <T> T | treeToValue(TreeNode n, JavaType valueType)
Same as |
| public TypeFactory | |
| public Version | version()
Implements tools. Method that will return version information stored in and read from jar that contains this class. |
| public ObjectReader | with(DeserializationFeature feature)
Method for constructing a new reader instance that is configured with specified feature enabled. |
| public ObjectReader | with(DeserializationFeature first, DeserializationFeature... other)
Method for constructing a new reader instance that is configured with specified features enabled. |
| public ObjectReader | with(DatatypeFeature feature)
Method for constructing a new reader instance that is configured with specified feature enabled. |
| public ObjectReader | with(StreamReadFeature feature)
Method for constructing a new reader instance that is configured with specified feature enabled. |
| public ObjectReader | with(FormatFeature feature)
Method for constructing a new reader instance that is configured with specified feature enabled. |
| public ObjectReader | with(DeserializationConfig config)
Mutant factory method that will construct a new instance that has
specified underlying |
| public ObjectReader | with(InjectableValues injectableValues)
Method for constructing a new instance with configuration that uses
passed |
| public ObjectReader | with(JsonNodeFactory f)
Method for constructing a new reader instance with configuration that uses
passed |
| public ObjectReader | with(FormatSchema schema)
Method for constructing a new instance with configuration that
passes specified |
| public ObjectReader | |
| public ObjectReader | |
| public ObjectReader | |
| public ObjectReader | Returns: ObjectReader instance with specified default attributes (which
is usually a newly constructed reader instance with otherwise identical settings)Default attrs)ContextAttributes to use with a readerMutant factory for overriding set of (default) attributes for
|
| public ObjectReader | |
| public ObjectReader | |
| public ObjectReader | withFeatures(DeserializationFeature... features)
Method for constructing a new reader instance that is configured with specified features enabled. |
| public ObjectReader | withFeatures(DatatypeFeature... features)
Method for constructing a new reader instance that is configured with specified features enabled. |
| public ObjectReader | withFeatures(StreamReadFeature... features)
Method for constructing a new reader instance that is configured with specified features enabled. |
| public ObjectReader | withFeatures(FormatFeature... features)
Method for constructing a new reader instance that is configured with specified features enabled. |
| public ObjectReader | |
| public ObjectReader | without(DeserializationFeature feature)
Method for constructing a new reader instance that is configured with specified feature disabled. |
| public ObjectReader | without(DeserializationFeature first, DeserializationFeature... other)
Method for constructing a new reader instance that is configured with specified features disabled. |
| public ObjectReader | without(DatatypeFeature feature)
Method for constructing a new reader instance that is configured with specified feature disabled. |
| public ObjectReader | without(StreamReadFeature feature)
Method for constructing a new reader instance that is configured with specified feature disabled. |
| public ObjectReader | without(FormatFeature feature)
Method for constructing a new reader instance that is configured with specified feature disabled. |
| public ObjectReader | |
| public ObjectReader | withoutFeatures(DeserializationFeature... features)
Method for constructing a new reader instance that is configured with specified features disabled. |
| public ObjectReader | withoutFeatures(DatatypeFeature... features)
Method for constructing a new reader instance that is configured with specified features disabled. |
| public ObjectReader | withoutFeatures(StreamReadFeature... features)
Method for constructing a new reader instance that is configured with specified features disabled. |
| public ObjectReader | withoutFeatures(FormatFeature... features)
Method for constructing a new reader instance that is configured with specified features disabled. |
| public ObjectReader | withoutRootName()
Convenience method that is same as calling:
|
| public ObjectReader | withRootName(String rootName)
Method for constructing a new instance with configuration that specifies what root name to expect for "root name unwrapping". |
| public ObjectReader | |
| 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. |
| public ObjectReader | |
| public void |