/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withType(JavaType valueType) { if (valueType == _valueType) return this; // type is stored here, no need to make a copy of config return new ObjectReader(this, _config, valueType, _valueToUpdate, _schema, _injectableValues); }
/** * Method for constructing a new instance with configuration that uses * passed {@link InjectableValues} to provide injectable values. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 1.9 */ public ObjectReader withInjectableValues(InjectableValues injectableValues) { if (_injectableValues == injectableValues) { return this; } return new ObjectReader(this, _config, _valueType, _valueToUpdate, _schema, injectableValues); }
/** * Method for constructing a new instance with configuration that * passes specified {@link FormatSchema} to {@link JsonParser} that * is constructed for parsing content. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 1.8 */ public ObjectReader withSchema(FormatSchema schema) { if (_schema == schema) { return this; } return new ObjectReader(this, _config, _valueType, _valueToUpdate, schema, _injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * use specified injectable values. * * @param injectableValues Injectable values to use * * @since 1.9 */ public ObjectReader reader(InjectableValues injectableValues) { return new ObjectReader(this, copyDeserializationConfig(), null, null, null, injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * read or update instances of specified type * * @since 1.6 */ public ObjectReader reader(JavaType type) { return new ObjectReader(this, copyDeserializationConfig(), type, null, null, _injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * pass specific schema object to {@link JsonParser} used for * reading content. * * @param schema Schema to pass to parser * * @since 1.8 */ public ObjectReader reader(FormatSchema schema) { return new ObjectReader(this, copyDeserializationConfig(), null, null, schema, _injectableValues); }
/** * Method for constructing a new instance with configuration that * updates passed Object (as root value), instead of constructing * a new value. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withValueToUpdate(Object value) { if (value == _valueToUpdate) return this; if (value == null) { throw new IllegalArgumentException("cat not update null value"); } JavaType t = (_valueType == null) ? _config.constructType(value.getClass()) : _valueType; return new ObjectReader(this, _config, t, value, _schema, _injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * use specified {@link JsonNodeFactory} for constructing JSON trees. * * @since 1.6 */ public ObjectReader reader(JsonNodeFactory f) { return new ObjectReader(this, copyDeserializationConfig()).withNodeFactory(f); }
/** * Factory method for constructing {@link ObjectReader} with * default settings. Note that the resulting instance is NOT usable as is, * without defining expected value type. * * @since 1.6 */ public ObjectReader reader() { return new ObjectReader(this, copyDeserializationConfig()) .withInjectableValues(_injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * update given Object (usually Bean, but can be a Collection or Map * as well, but NOT an array) with JSON data. Deserialization occurs * normally except that the root-level value in JSON is not used for * instantiating a new object; instead give updateable object is used * as root. * Runtime type of value object is used for locating deserializer, * unless overridden by other factory methods of {@link ObjectReader} * * @since 1.9 */ public ObjectReader readerForUpdating(Object valueToUpdate) { JavaType t = _typeFactory.constructType(valueToUpdate.getClass()); return new ObjectReader(this, copyDeserializationConfig(), t, valueToUpdate, null, _injectableValues); }
/** * Method for constructing a new reader instance with configuration that uses * passed {@link JsonNodeFactory} for constructing {@link JsonNode} * instances. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withNodeFactory(JsonNodeFactory f) { // node factory is stored within config, so need to copy that first if (f == _config.getNodeFactory()) return this; return new ObjectReader(this, _config.withNodeFactory(f), _valueType, _valueToUpdate, _schema, _injectableValues); }
/** * Method for constructing a new reader instance that is configured * to data bind into specified type. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withType(JavaType valueType) { if (valueType == _valueType) return this; // type is stored here, no need to make a copy of config return new ObjectReader(this, _config, valueType, _valueToUpdate, _schema, _injectableValues); }
/** * Method for constructing a new instance with configuration that uses * passed {@link InjectableValues} to provide injectable values. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. * * @since 1.9 */ public ObjectReader withInjectableValues(InjectableValues injectableValues) { if (_injectableValues == injectableValues) { return this; } return new ObjectReader(this, _config, _valueType, _valueToUpdate, _schema, injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * use specified injectable values. * * @param injectableValues Injectable values to use * * @since 1.9 */ public ObjectReader reader(InjectableValues injectableValues) { return new ObjectReader(this, copyDeserializationConfig(), null, null, null, injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * read or update instances of specified type * * @since 1.6 */ public ObjectReader reader(JavaType type) { return new ObjectReader(this, copyDeserializationConfig(), type, null, null, _injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * pass specific schema object to {@link JsonParser} used for * reading content. * * @param schema Schema to pass to parser * * @since 1.8 */ public ObjectReader reader(FormatSchema schema) { return new ObjectReader(this, copyDeserializationConfig(), null, null, schema, _injectableValues); }
/** * Factory method for constructing {@link ObjectReader} with * default settings. Note that the resulting instance is NOT usable as is, * without defining expected value type. * * @since 1.6 */ public ObjectReader reader() { return new ObjectReader(this, copyDeserializationConfig()) .withInjectableValues(_injectableValues); }
/** * Factory method for constructing {@link ObjectReader} that will * use specified {@link JsonNodeFactory} for constructing JSON trees. * * @since 1.6 */ public ObjectReader reader(JsonNodeFactory f) { return new ObjectReader(this, copyDeserializationConfig()).withNodeFactory(f); }
/** * Factory method for constructing {@link ObjectReader} that will * update given Object (usually Bean, but can be a Collection or Map * as well, but NOT an array) with JSON data. Deserialization occurs * normally except that the root-level value in JSON is not used for * instantiating a new object; instead give updateable object is used * as root. * Runtime type of value object is used for locating deserializer, * unless overridden by other factory methods of {@link ObjectReader} * * @since 1.9 */ public ObjectReader readerForUpdating(Object valueToUpdate) { JavaType t = _typeFactory.constructType(valueToUpdate.getClass()); return new ObjectReader(this, copyDeserializationConfig(), t, valueToUpdate, null, _injectableValues); }
/** * Method for constructing a new reader instance with configuration that uses * passed {@link JsonNodeFactory} for constructing {@link JsonNode} * instances. *<p> * Note that the method does NOT change state of this reader, but * rather construct and returns a newly configured instance. */ public ObjectReader withNodeFactory(JsonNodeFactory f) { // node factory is stored within config, so need to copy that first if (f == _config.getNodeFactory()) return this; return new ObjectReader(this, _config.withNodeFactory(f), _valueType, _valueToUpdate, _schema, _injectableValues); }