public ObjectReader withValueToUpdate(Object value) { if (value == _valueToUpdate) return this; if (value == null) { throw new IllegalArgumentException("cat not update null value"); } JavaType t = _config.constructType(value.getClass()); return new ObjectReader(this, _config, t, value, _schema, _injectableValues); }
protected ObjectReader( ObjectMapper mapper, DeserializationConfig config, JavaType valueType, Object valueToUpdate, FormatSchema schema, InjectableValues injectableValues) { _config = config; _rootDeserializers = mapper._rootDeserializers; _provider = mapper._deserializerProvider; _jsonFactory = mapper._jsonFactory; _valueType = valueType; _valueToUpdate = valueToUpdate; if (valueToUpdate != null && valueType.isArrayType()) { throw new IllegalArgumentException("Can not update an array value"); } _schema = schema; _injectableValues = injectableValues; _unwrapRoot = config.isEnabled(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE); }
@Override public JsonNode createObjectNode() { return _config.getNodeFactory().objectNode(); }
@Override public JsonNode createArrayNode() { return _config.getNodeFactory().arrayNode(); }
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); }
/** @since 1.8 */ public ObjectReader withType(TypeReference<?> valueTypeRef) { return withType(_config.getTypeFactory().constructType(valueTypeRef.getType())); }
public ObjectReader withType(java.lang.reflect.Type valueType) { return withType(_config.getTypeFactory().constructType(valueType)); }
public ObjectReader withType(Class<?> valueType) { return withType(_config.constructType(valueType)); }