My Code :
private class CustomBeanSerializerModifier extends BeanSerializerModifier{
@Override
public List<BeanPropertyWriter> changeProperties(SerializationConfig config,
BeanDescription beanDesc,List<BeanPropertyWriter> beanProperties){
List<BeanPropertyWriter> beanPropertiesToIgnore = new ArrayList<>();
if (!CollectionUtils.isEmpty(fieldSettingsMap)) {
for (int i = 0; i < beanProperties.size(); i++) {
BeanPropertyWriter beanPropertyWriter = beanProperties.get(i);
... ...
What i want is to add a new property here say, String identifier = "someValue"; i want this property to be added(with some condition) to the serialized json.
The only constructor of BeanPropertyWriter takes lot of arguments :
new BeanPropertyWriter(propDef, member, contextAnnotations, declaredType, ser, typeSer, serType, suppressNulls, suppressableValue)
Can i add a new property here at all? if yes, what are the values i should pass to the constructor here?