}
return g;
}
protected JsonFactory getJsonFactory(Set<URI> flags) {
JsonFactory f = new JsonFactory();
ObjectMapper codec = new ObjectMapper();
if (flags.contains(RepresentationFactory.STRIP_NULLS)) {
codec.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}
//if SINGLE_ELEM_ARRAYS is set, write arrays with one element as an array
//rather than a single value.
codec.configure(SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED,
!flags.contains(RepresentationFactory.SINGLE_ELEM_ARRAYS));
f.setCodec(codec);
f.enable(JsonGenerator.Feature.QUOTE_FIELD_NAMES);
return f;
}