protected JsonNode _bindAsTree(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { JsonNode result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = NullNode.instance; } else { DeserializationContext ctxt = _createDeserializationContext(jp, _config); JsonDeserializer<Object> deser = _findRootDeserializer(_config, JSON_NODE_TYPE); if (_unwrapRoot) { result = (JsonNode) _unwrapAndDeserialize(jp, ctxt, JSON_NODE_TYPE, deser); } else { result = (JsonNode) deser.deserialize(jp, ctxt); } } // Need to consume the token too jp.clearCurrentToken(); return result; }
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
protected JsonNode _bindAsTree(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { JsonNode result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = NullNode.instance; } else { DeserializationContext ctxt = _createDeserializationContext(jp, _config); JsonDeserializer<Object> deser = _findRootDeserializer(_config, JSON_NODE_TYPE); if (_unwrapRoot) { result = (JsonNode) _unwrapAndDeserialize(jp, ctxt, JSON_NODE_TYPE, deser); } else { result = (JsonNode) deser.deserialize(jp, ctxt); } } // Need to consume the token too jp.clearCurrentToken(); return result; }
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
protected JsonNode _bindAsTree(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { JsonNode result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = NullNode.instance; } else { DeserializationContext ctxt = _createDeserializationContext(jp, _config); // Bit more complicated, since we may need to override node factory: result = (JsonNode) _findRootDeserializer(_config, JSON_NODE_TYPE).deserialize(jp, ctxt); } // Need to consume the token too jp.clearCurrentToken(); return result; }
protected JsonNode _bindAsTree(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { JsonNode result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = NullNode.instance; } else { DeserializationContext ctxt = _createDeserializationContext(jp, _config); JsonDeserializer<Object> deser = _findRootDeserializer(_config, JSON_NODE_TYPE); if (_unwrapRoot) { result = (JsonNode) _unwrapAndDeserialize(jp, ctxt, JSON_NODE_TYPE, deser); } else { result = (JsonNode) deser.deserialize(jp, ctxt); } } // Need to consume the token too jp.clearCurrentToken(); return result; }
protected JsonNode _bindAsTree(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { JsonNode result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = NullNode.instance; } else { DeserializationContext ctxt = _createDeserializationContext(jp, _config); JsonDeserializer<Object> deser = _findRootDeserializer(_config, JSON_NODE_TYPE); if (_unwrapRoot) { result = (JsonNode) _unwrapAndDeserialize(jp, ctxt, JSON_NODE_TYPE, deser); } else { result = (JsonNode) deser.deserialize(jp, ctxt); } } // Need to consume the token too jp.clearCurrentToken(); return result; }
/** * Actual implementation of value reading+binding operation. */ protected Object _bind(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { /* First: may need to read the next token, to initialize state (either * before first read from parser, or after previous token has been cleared) */ Object result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = _valueToUpdate; } else { // pointing to event other than null DeserializationContext ctxt = _createDeserializationContext(jp, _config); if (_valueToUpdate == null) { result = _findRootDeserializer(_config, _valueType).deserialize(jp, ctxt); } else { _findRootDeserializer(_config, _valueType).deserialize(jp, ctxt, _valueToUpdate); result = _valueToUpdate; } } // Need to consume the token too jp.clearCurrentToken(); return result; }
protected Object _bindAndClose(JsonParser jp) throws IOException, JsonParseException, JsonMappingException { if (_schema != null) { jp.setSchema(_schema); } try { Object result; JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL || t == JsonToken.END_ARRAY || t == JsonToken.END_OBJECT) { result = _valueToUpdate; } else { DeserializationContext ctxt = _createDeserializationContext(jp, _config); if (_valueToUpdate == null) { result = _findRootDeserializer(_config, _valueType).deserialize(jp, ctxt); } else { _findRootDeserializer(_config, _valueType).deserialize(jp, ctxt, _valueToUpdate); result = _valueToUpdate; } } return result; } finally { try { jp.close(); } catch (IOException ioe) { } } }
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {
JsonToken t = _initForReading(jp); if (t == JsonToken.VALUE_NULL) { if (_valueToUpdate == null) {