/** * Method called to locate deserializer ahead of time, if permitted * by configuration. Method also is NOT to throw an exception if * access fails. */ protected JsonDeserializer<Object> _prefetchRootDeserializer(JavaType valueType) { if ((valueType == null) || !_config.isEnabled(DeserializationFeature.EAGER_DESERIALIZER_FETCH)) { return null; } // already cached? JsonDeserializer<Object> deser = _rootDeserializers.get(valueType); if (deser == null) { try { // If not, need to resolve; for which we need a temporary context as well: DeserializationContext ctxt = createDeserializationContext(null); deser = ctxt.findRootValueDeserializer(valueType); if (deser != null) { _rootDeserializers.put(valueType, deser); } return deser; } catch (JsonProcessingException e) { // need to swallow? } } return deser; } }
/** * @since 2.1 */ protected <T> MappingIterator<T> _bindAndReadValues(JsonParser p) throws IOException { DeserializationContext ctxt = createDeserializationContext(p); _initForMultiRead(ctxt, p); p.nextToken(); return _newIterator(p, ctxt, _findRootDeserializer(ctxt), true); }
/** * Method for reading sequence of Objects from parser stream. *<p> * Sequence can be either root-level "unwrapped" sequence (without surrounding * JSON array), or a sequence contained in a JSON Array. * In either case {@link JsonParser} must point to the first token of * the first element, OR not point to any token (in which case it is advanced * to the next token). This means, specifically, that for wrapped sequences, * parser MUST NOT point to the surrounding <code>START_ARRAY</code> but rather * to the token following it. */ public <T> MappingIterator<T> readValues(JsonParser p) throws IOException { DeserializationContext ctxt = createDeserializationContext(p); // false -> do not close as caller gave parser instance return _newIterator(p, ctxt, _findRootDeserializer(ctxt), false); }
/** * Overloaded version of {@link #readValue(InputStream)}. */ @SuppressWarnings("resource") public <T> MappingIterator<T> readValues(Reader src) throws IOException { if (_dataFormatReaders != null) { _reportUndetectableSource(src); } JsonParser p = _considerFilter(_parserFactory.createParser(src), true); DeserializationContext ctxt = createDeserializationContext(p); _initForMultiRead(ctxt, p); p.nextToken(); return _newIterator(p, ctxt, _findRootDeserializer(ctxt), true); }
/** * Overloaded version of {@link #readValue(InputStream)}. * * @param json String that contains JSON content to parse */ @SuppressWarnings("resource") public <T> MappingIterator<T> readValues(String json) throws IOException { if (_dataFormatReaders != null) { _reportUndetectableSource(json); } JsonParser p = _considerFilter(_parserFactory.createParser(json), true); DeserializationContext ctxt = createDeserializationContext(p); _initForMultiRead(ctxt, p); p.nextToken(); return _newIterator(p, ctxt, _findRootDeserializer(ctxt), true); }
DeserializationContext ctxt = createDeserializationContext(p); if (t == JsonToken.VALUE_NULL) { return ctxt.getNodeFactory().nullNode();
Object result; DeserializationContext ctxt = createDeserializationContext(p); JsonToken t = _initForReading(ctxt, p); if (t == JsonToken.VALUE_NULL) {
final DeserializationContext ctxt = createDeserializationContext(p); JsonToken t = _initForReading(ctxt, p); if (t == JsonToken.VALUE_NULL) {
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(JsonParser jp) throws IOException, JsonProcessingException { DeserializationContext ctxt = createDeserializationContext(jp, _config); // false -> do not close as caller gave parser instance return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), false, _valueToUpdate); }
/** * @since 2.1 */ protected <T> MappingIterator<T> _bindAndReadValues(JsonParser p, Object valueToUpdate) throws IOException { _initForMultiRead(p); p.nextToken(); DeserializationContext ctxt = createDeserializationContext(p, _config); return _newIterator(_valueType, p, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * @since 2.1 */ protected <T> MappingIterator<T> _bindAndReadValues(JsonParser p) throws IOException { DeserializationContext ctxt = createDeserializationContext(p); _initForMultiRead(ctxt, p); p.nextToken(); return _newIterator(p, ctxt, _findRootDeserializer(ctxt), true); }
/** * @since 2.1 */ protected <T> MappingIterator<T> _bindAndReadValues(JsonParser p, Object valueToUpdate) throws IOException { _initForMultiRead(p); p.nextToken(); DeserializationContext ctxt = createDeserializationContext(p, _config); return _newIterator(_valueType, p, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * @since 2.1 */ protected <T> MappingIterator<T> _bindAndReadValues(JsonParser p) throws IOException { DeserializationContext ctxt = createDeserializationContext(p); _initForMultiRead(ctxt, p); p.nextToken(); return _newIterator(p, ctxt, _findRootDeserializer(ctxt), true); }
/** * Overloaded version of {@link #readValue(InputStream)}. * * @param json String that contains JSON content to parse */ @SuppressWarnings("resource") public <T> MappingIterator<T> readValues(String json) throws IOException, JsonProcessingException { if (_dataFormatReaders != null) { _reportUndetectableSource(json); } JsonParser p = _considerFilter(_parserFactory.createParser(json), true); DeserializationContext ctxt = createDeserializationContext(p); _initForMultiRead(ctxt, p); p.nextToken(); return _newIterator(p, ctxt, _findRootDeserializer(ctxt), true); }
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(InputStream src) throws IOException, JsonProcessingException { JsonParser jp = _jsonFactory.createJsonParser(src); if (_schema != null) { jp.setSchema(_schema); } DeserializationContext ctxt = createDeserializationContext(jp, _config); return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(File src) throws IOException, JsonProcessingException { JsonParser jp = _jsonFactory.createJsonParser(src); if (_schema != null) { jp.setSchema(_schema); } DeserializationContext ctxt = createDeserializationContext(jp, _config); return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(URL src) throws IOException, JsonProcessingException { JsonParser jp = _jsonFactory.createJsonParser(src); if (_schema != null) { jp.setSchema(_schema); } DeserializationContext ctxt = createDeserializationContext(jp, _config); return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(Reader src) throws IOException, JsonProcessingException { JsonParser jp = _jsonFactory.createJsonParser(src); if (_schema != null) { jp.setSchema(_schema); } DeserializationContext ctxt = createDeserializationContext(jp, _config); return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(String json) throws IOException, JsonProcessingException { JsonParser jp = _jsonFactory.createJsonParser(json); if (_schema != null) { jp.setSchema(_schema); } DeserializationContext ctxt = createDeserializationContext(jp, _config); return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }
/** * Method for reading sequence of Objects from parser stream. */ public <T> MappingIterator<T> readValues(byte[] src, int offset, int length) throws IOException, JsonProcessingException { JsonParser jp = _jsonFactory.createJsonParser(src, offset, length); if (_schema != null) { jp.setSchema(_schema); } DeserializationContext ctxt = createDeserializationContext(jp, _config); return new MappingIterator<T>(_valueType, jp, ctxt, _findRootDeserializer(ctxt, _valueType), true, _valueToUpdate); }