use of com.fasterxml.jackson.databind.module.SimpleSerializers in project pinpoint by naver.
the class JacksonPinpointModule method setupModule.
/* (non-Javadoc)
* @see com.fasterxml.jackson.databind.Module#setupModule(org.codehaus.jackson.map.Module.SetupContext)
*/
@Override
public void setupModule(SetupContext context) {
SimpleSerializers serializers = new SimpleSerializers();
serializers.addSerializer(ServiceType.class, new ServiceTypeSerializer());
context.addSerializers(serializers);
}
use of com.fasterxml.jackson.databind.module.SimpleSerializers in project sling by apache.
the class ResourceModuleProvider method activate.
@Activate
private void activate(Map<String, Object> props) {
final int maxRecursionLevels = PropertiesUtil.toInteger(props.get(PROP_MAX_RECURSION_LEVELS), DEFAULT_MAX_RECURSION_LEVELS);
this.moduleInstance = new SimpleModule();
SimpleSerializers serializers = new SimpleSerializers();
serializers.addSerializer(Resource.class, new ResourceSerializer(maxRecursionLevels));
moduleInstance.setSerializers(serializers);
}
use of com.fasterxml.jackson.databind.module.SimpleSerializers in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageModuleProviderTest method testPageModule.
@Test
public void testPageModule() throws Exception {
PageModuleProvider pmp = new PageModuleProvider();
Module module = pmp.getModule();
assertTrue(module instanceof SimpleModule);
Field field = module.getClass().getDeclaredField("_serializers");
field.setAccessible(true);
SimpleSerializers simpleSerializers = (SimpleSerializers) field.get(module);
field = simpleSerializers.getClass().getDeclaredField("_interfaceMappings");
field.setAccessible(true);
HashMap<ClassKey, JsonSerializer<?>> classMappings = (HashMap) field.get(simpleSerializers);
assertTrue(classMappings.containsKey(new ClassKey(Page.class)));
}
use of com.fasterxml.jackson.databind.module.SimpleSerializers in project hive by apache.
the class MapCapableJsonMetricsModule method setupModule.
public void setupModule(SetupContext context) {
super.setupModule(context);
context.addSerializers(new SimpleSerializers(ImmutableList.of(new MetricRegistrySerializer(version(), MetricFilter.ALL), new MapMetricsBeanSerializer())));
}
use of com.fasterxml.jackson.databind.module.SimpleSerializers in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class PageModuleProviderTest method testPageModule.
@Test
public void testPageModule() throws Exception {
PageModuleProvider pmp = new PageModuleProvider();
Module module = pmp.getModule();
assertTrue(module instanceof SimpleModule);
Field field = module.getClass().getDeclaredField("_serializers");
field.setAccessible(true);
SimpleSerializers simpleSerializers = (SimpleSerializers) field.get(module);
field = simpleSerializers.getClass().getDeclaredField("_interfaceMappings");
field.setAccessible(true);
HashMap<ClassKey, JsonSerializer<?>> classMappings = (HashMap) field.get(simpleSerializers);
assertTrue(classMappings.containsKey(new ClassKey(Page.class)));
}
Aggregations