Skip to content

JsonGenerator Features

Tatu Saloranta edited this page Nov 18, 2013 · 6 revisions

Jackson Streaming: JsonGenerator.Feature

Jackson Streaming API has a set of on/off features that change the way streaming parsing is done. Features can be directly enabled/disabled on JsonGenerator instances, but more commonly default values are changed on JsonFactory instances. For example:

JsonFactory f = new JsonFactory();
f.enable(JsonGenerator.Feature.ESCAPE_NON_ASCII);
f.disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
JsonGenerator g = f.createGenerator(destination);
p.enable(JsonGenerator.Feature.STRICT_DUPLICATE_DETECTION);

Settings can be divided in couple of loose categories, as follows.

Low-level I/O handling features

Clone this wiki locally