public JacksonSerializer() { this.serializerFactory = new CustomSerializerFactory(); this.serializerFactory.addGenericMapping(CGLIBLazyInitializer.class, new CGLIBLazyInitializerHandler()); this.factory = new MappingJsonFactory(new ObjectMapper(this.serializerFactory)); this.factory.setGeneratorFeature(JsonGenerator.Feature.QUOTE_FIELD_NAMES, true); }
/** * Constructor. */ public CustomSerializerHelper() { customSerializerModule = new SimpleModule("custom-serializers", new Version(1, 0, 0, null)); sf = new CustomSerializerFactory(); }
public CustomObjectMapper() { CustomSerializerFactory sf = new CustomSerializerFactory(); sf.addSpecificMapping(ObjectId.class, new ObjectIdSerializer()); this.setSerializerFactory(sf); }