List of usage examples for com.fasterxml.jackson.databind MappingJsonFactory createGenerator
public JsonGenerator createGenerator(OutputStream out, JsonEncoding enc) throws IOException
From source file:org.apache.arrow.vector.file.json.JsonFileWriter.java
public JsonFileWriter(File outputFile, JSONWriteConfig config) throws IOException { MappingJsonFactory jsonFactory = new MappingJsonFactory(); this.generator = jsonFactory.createGenerator(outputFile, JsonEncoding.UTF8); if (config.pretty) { DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(); prettyPrinter.indentArraysWith(NopIndenter.instance); this.generator.setPrettyPrinter(prettyPrinter); }//from w ww. ja va 2 s . co m }
From source file:org.apache.arrow.vector.ipc.JsonFileWriter.java
public JsonFileWriter(File outputFile, JSONWriteConfig config) throws IOException { MappingJsonFactory jsonFactory = new MappingJsonFactory(); this.generator = jsonFactory.createGenerator(outputFile, JsonEncoding.UTF8); if (config.pretty) { DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(); prettyPrinter.indentArraysWith(NopIndenter.instance); this.generator.setPrettyPrinter(prettyPrinter); }//www . ja v a2 s. co m // Allow writing of floating point NaN values not as strings this.generator.configure(JsonGenerator.Feature.QUOTE_NON_NUMERIC_NUMBERS, false); }