Search in sources :

Example 1 with BeanPropertyFilter

use of com.fasterxml.jackson.databind.ser.BeanPropertyFilter in project uPortal by Jasig.

the class AnalyticsIncorporationComponent method initMapper.

/**
     * Configure the ObjectMapper to filter out all fields on the events except those that are
     * actually needed for the analytics reporting
     */
private void initMapper() {
    final BeanPropertyFilter filterOutAllExcept = SimpleBeanPropertyFilter.filterOutAllExcept("fname", "executionTimeNano");
    this.mapper.addMixInAnnotations(PortalEvent.class, PortletRenderExecutionEventFilterMixIn.class);
    final SimpleFilterProvider filterProvider = new SimpleFilterProvider();
    filterProvider.addFilter(PortletRenderExecutionEventFilterMixIn.FILTER_NAME, filterOutAllExcept);
    this.portletEventWriter = this.mapper.writer(filterProvider);
}
Also used : SimpleFilterProvider(com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider) SimpleBeanPropertyFilter(com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter) BeanPropertyFilter(com.fasterxml.jackson.databind.ser.BeanPropertyFilter)

Aggregations

BeanPropertyFilter (com.fasterxml.jackson.databind.ser.BeanPropertyFilter)1 SimpleBeanPropertyFilter (com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter)1 SimpleFilterProvider (com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider)1