/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). * * @param content JSON content to parse to build the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(byte[] content) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(content)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). * * @param file File of which contents to parse as JSON for building a tree instance * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws IOException if a low-level I/O problem (unexpected end-of-input, * network error) occurs (passed through as-is without additional wrapping -- note * that this is one case where {@link DeserializationFeature#WRAP_EXCEPTIONS} * does NOT result in wrapping of exception even if enabled) * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(File file) throws IOException, JsonProcessingException { return _readTreeAndClose(_jsonFactory.createParser(file)); }
/** * Method to deserialize JSON content as tree expressed * using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist * of just a single node if the current event is a * value event, not container). *<p> * If a low-level I/O problem (missing input, network error) occurs, * a {@link IOException} will be thrown. * If a parsing problem occurs (invalid JSON), * {@link JsonParseException} will be thrown. * If no content is found from input (end-of-input), Java * <code>null</code> will be returned. * * @param r Reader used to read JSON content * for building the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} */ public JsonNode readTree(Reader r) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(r)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). * * @param source URL to use for fetching contents to parse as JSON for building a tree instance * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws IOException if a low-level I/O problem (unexpected end-of-input, * network error) occurs (passed through as-is without additional wrapping -- note * that this is one case where {@link DeserializationFeature#WRAP_EXCEPTIONS} * does NOT result in wrapping of exception even if enabled) * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(URL source) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(source)); }
/** * Method to deserialize JSON content as tree expressed * using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist * of just a single node if the current event is a * value event, not container). *<p> * If a low-level I/O problem (missing input, network error) occurs, * a {@link IOException} will be thrown. * If a parsing problem occurs (invalid JSON), * {@link JsonParseException} will be thrown. * If no content is found from input (end-of-input), Java * <code>null</code> will be returned. * * @param in Input stream used to read JSON content * for building the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(InputStream in) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(in)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). *<p> * If a low-level I/O problem (missing input, network error) occurs, * a {@link IOException} will be thrown. * If a parsing problem occurs (invalid JSON), * {@link JsonParseException} will be thrown. * If no content is found from input (end-of-input), Java * <code>null</code> will be returned. * * @param content JSON content to parse to build the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(String content) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(content)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). * * @param content JSON content to parse to build the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(byte[] content) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(content)); }
/** * Method to deserialize JSON content as tree expressed * using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist * of just a single node if the current event is a * value event, not container). *<p> * If a low-level I/O problem (missing input, network error) occurs, * a {@link IOException} will be thrown. * If a parsing problem occurs (invalid JSON), * {@link JsonParseException} will be thrown. * If no content is found from input (end-of-input), Java * <code>null</code> will be returned. * * @param r Reader used to read JSON content * for building the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} */ public JsonNode readTree(Reader r) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(r)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). *<p> * If a low-level I/O problem (missing input, network error) occurs, * a {@link IOException} will be thrown. * If a parsing problem occurs (invalid JSON), * {@link JsonParseException} will be thrown. * If no content is found from input (end-of-input), Java * <code>null</code> will be returned. * * @param content JSON content to parse to build the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(String content) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(content)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). * * @param source URL to use for fetching contents to parse as JSON for building a tree instance * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws IOException if a low-level I/O problem (unexpected end-of-input, * network error) occurs (passed through as-is without additional wrapping -- note * that this is one case where {@link DeserializationFeature#WRAP_EXCEPTIONS} * does NOT result in wrapping of exception even if enabled) * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(URL source) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(source)); }
/** * Method to deserialize JSON content as tree expressed using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist of just a single node if the current * event is a value event, not container). * * @param file File of which contents to parse as JSON for building a tree instance * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws IOException if a low-level I/O problem (unexpected end-of-input, * network error) occurs (passed through as-is without additional wrapping -- note * that this is one case where {@link DeserializationFeature#WRAP_EXCEPTIONS} * does NOT result in wrapping of exception even if enabled) * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(File file) throws IOException, JsonProcessingException { return _readTreeAndClose(_jsonFactory.createParser(file)); }
/** * Method to deserialize JSON content as tree expressed * using set of {@link JsonNode} instances. * Returns root of the resulting tree (where root can consist * of just a single node if the current event is a * value event, not container). *<p> * If a low-level I/O problem (missing input, network error) occurs, * a {@link IOException} will be thrown. * If a parsing problem occurs (invalid JSON), * {@link JsonParseException} will be thrown. * If no content is found from input (end-of-input), Java * <code>null</code> will be returned. * * @param in Input stream used to read JSON content * for building the JSON tree. * * @return a {@link JsonNode}, if valid JSON content found; null * if input has no content to bind -- note, however, that if * JSON <code>null</code> token is found, it will be represented * as a non-null {@link JsonNode} (one that returns <code>true</code> * for {@link JsonNode#isNull()} * * @throws JsonParseException if underlying input contains invalid content * of type {@link JsonParser} supports (JSON for default case) */ public JsonNode readTree(InputStream in) throws IOException { return _readTreeAndClose(_jsonFactory.createParser(in)); }