Last active
January 9, 2017 04:29
-
-
Save dailymartin/b16336fc4d27505c1fcc9107bb14268c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected ObjectWriter configureObjectMapper(ObjectMapper jsonObjectMapper) { | |
| jsonObjectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); | |
| jsonObjectMapper.setDateFormat(new ISO8601DateFormat()); | |
| SimpleFilterProvider filters = new SimpleFilterProvider(); | |
| filters.addFilter("validateFilter", SimpleBeanPropertyFilter.serializeAllExcept(new String[]{"valid", "validationErrors"})); | |
| filters.addFilter("pkPassFilter", SimpleBeanPropertyFilter.serializeAllExcept(new String[]{"valid", "validationErrors", "foregroundColorAsObject", "backgroundColorAsObject", "labelColorAsObject", "passThatWasSet"})); | |
| filters.addFilter("barcodeFilter", SimpleBeanPropertyFilter.serializeAllExcept(new String[]{"valid", "validationErrors", "messageEncodingAsString"})); | |
| filters.addFilter("charsetFilter", SimpleBeanPropertyFilter.filterOutAllExcept(new String[]{"name"})); | |
| jsonObjectMapper.setSerializationInclusion(Include.NON_NULL); | |
| jsonObjectMapper.addMixIn(Object.class, PKAbstractSIgningUtil.ValidateFilterMixIn.class); | |
| jsonObjectMapper.addMixIn(PKPass.class, PKAbstractSIgningUtil.PkPassFilterMixIn.class); | |
| jsonObjectMapper.addMixIn(PKBarcode.class, PKAbstractSIgningUtil.BarcodeFilterMixIn.class); | |
| jsonObjectMapper.addMixIn(Charset.class, PKAbstractSIgningUtil.CharsetFilterMixIn.class); | |
| return jsonObjectMapper.writer(filters); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment