protected JsonParser configure(JsonParser parser) { return parser.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false); }
public SdkJsonNode parse(InputStream content) throws IOException { try (JsonParser parser = jsonFactory.createParser(content) .configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false)) { return parseToken(parser, parser.nextToken()); } }
public SdkJsonNode parse(InputStream content) throws IOException { try (JsonParser parser = jsonFactory.createParser(content) .configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false)) { return parseToken(parser, parser.nextToken()); } }
private static void configure(JsonParser parser, JsonParser.Feature feature, boolean enabled) { if (feature.enabledByDefault() == enabled) { return; } parser.configure(feature, enabled); }
public JsonFileReader(File inputFile, BufferAllocator allocator) throws JsonParseException, IOException { super(); this.allocator = allocator; MappingJsonFactory jsonFactory = new MappingJsonFactory(); this.parser = jsonFactory.createParser(inputFile); // Allow reading NaN for floating point values this.parser.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true); }
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); jsonParser.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); JsonNode node = objectMapper.readTree(jsonParser); for (JsonNode extractor : node.get(JSON_KEY)) {
@Override public JzonElement parse(String json) { try { JsonParser parser = JSON.getJsonFactory().createJsonParser(json); parser.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); parser.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); return wrap(parser.readValueAsTree()); } catch (JsonProcessingException e) { throw new Jackson2WrapperException("Failed to parse JSON", e); } catch (IOException e) { throw new Jackson2WrapperException("IOException parsing a String?", e); } }
private long parsePath(TimelineDataManager tdm, Path logPath, boolean appCompleted, JsonFactory jsonFactory, ObjectMapper objMapper, FileSystem fs) throws IOException { UserGroupInformation ugi = UserGroupInformation.createRemoteUser(user); FSDataInputStream in = fs.open(logPath); JsonParser parser = null; try { in.seek(offset); try { parser = jsonFactory.createParser((InputStream)in); parser.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false); } catch (IOException e) { // if app hasn't completed then there may be errors due to the // incomplete file which are treated as EOF until app completes if (appCompleted) { throw e; } else { LOG.debug("Exception in parse path: {}", e.getMessage()); return 0; } } return doParse(tdm, parser, objMapper, ugi, appCompleted); } finally { IOUtils.closeStream(parser); IOUtils.closeStream(in); } }
@Override public JzonElement parse(String json) { try { JsonParser parser = JSON.getJsonFactory().createJsonParser(json); parser.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); parser.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); return wrap(parser.readValueAsTree()); } catch (JsonProcessingException e) { throw new Jackson2WrapperException("Failed to parse JSON", e); } catch (IOException e) { throw new Jackson2WrapperException("IOException parsing a String?", e); } }
jp.configure( JsonParser.Feature.AUTO_CLOSE_SOURCE, false );
jp.configure( JsonParser.Feature.AUTO_CLOSE_SOURCE, false ); EntityDef rootEntity = qualBuilder.getLodDef().getRoot();