public void setupModule(SetupContext context) { context.addBeanSerializerModifier(new BeanSerializerModifier() { @Override public List<BeanPropertyWriter> changeProperties(SerializationConfig config, BasicBeanDescription beanDesc, List<BeanPropertyWriter> beanProperties) { ListIterator<BeanPropertyWriter> it = beanProperties.listIterator(); while (it.hasNext()) { BeanPropertyWriter writer = it.next(); // replace the bean writer with my own if it is for "failed" if (writer.getName().equals("failed")) { BeanPropertyWriter newWriter = new IsFailedWriter(writer); it.set(newWriter); } } return beanProperties; } }); }
public final SerializerFactory withSerializerModifier(BeanSerializerModifier paramBeanSerializerModifier) { return withConfig(getConfig().withSerializerModifier(paramBeanSerializerModifier)); }
public abstract Iterable<BeanSerializerModifier> serializerModifiers();
public abstract Config withSerializerModifier(BeanSerializerModifier paramBeanSerializerModifier);
public abstract void addBeanSerializerModifier(BeanSerializerModifier paramBeanSerializerModifier);