@Override
 public void setupModule(SetupContext context) {
   /* First, append annotation introspector (no need to override, esp.
    * as we just implement couple of methods)
    */
   // Then add serializers we need
   AnnotationIntrospector ai = annotationIntrospector();
   if (ai != null) {
     context.appendAnnotationIntrospector(ai);
   }
   context.addSerializers(new HibernateSerializers(_moduleFeatures));
 }
示例#2
0
 @Override
 public void setupModule(SetupContext context) {
   if (_serializers != null) {
     context.addSerializers(_serializers);
   }
   if (_deserializers != null) {
     context.addDeserializers(_deserializers);
   }
   if (_keySerializers != null) {
     context.addKeySerializers(_keySerializers);
   }
   if (_keyDeserializers != null) {
     context.addKeyDeserializers(_keyDeserializers);
   }
   if (_abstractTypes != null) {
     context.addAbstractTypeResolver(_abstractTypes);
   }
   if (_valueInstantiators != null) {
     context.addValueInstantiators(_valueInstantiators);
   }
   if (_subtypes != null && _subtypes.size() > 0) {
     context.registerSubtypes(_subtypes.toArray(new NamedType[_subtypes.size()]));
   }
   if (_mixins != null) {
     for (Map.Entry<Class<?>, Class<?>> entry : _mixins.entrySet()) {
       context.setMixInAnnotations(entry.getKey(), entry.getValue());
     }
   }
 }
 @Override
 public void setupModule(SetupContext context) {
   /* First, append annotation introspector (no need to override, esp.
    * as we just implement couple of methods)
    */
   // Then add serializers we need
   AnnotationIntrospector ai = annotationIntrospector();
   if (ai != null) {
     context.appendAnnotationIntrospector(ai);
   }
   boolean forceLoading = isEnabled(Feature.FORCE_LAZY_LOADING);
   context.addSerializers(
       new HibernateSerializers(
           forceLoading,
           isEnabled(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS),
           _mapping));
   context.addBeanSerializerModifier(new HibernateSerializerModifier(forceLoading));
 }