コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 @Override
 public JsonNode createObjectNode() {
   return _config.getNodeFactory().objectNode();
 }
コード例 #4
0
 @Override
 public JsonNode createArrayNode() {
   return _config.getNodeFactory().arrayNode();
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 /** @since 1.8 */
 public ObjectReader withType(TypeReference<?> valueTypeRef) {
   return withType(_config.getTypeFactory().constructType(valueTypeRef.getType()));
 }
コード例 #7
0
 public ObjectReader withType(java.lang.reflect.Type valueType) {
   return withType(_config.getTypeFactory().constructType(valueType));
 }
コード例 #8
0
 public ObjectReader withType(Class<?> valueType) {
   return withType(_config.constructType(valueType));
 }