java - Is there a way to modify a POJO field and return the POJO -


is there way modify field of pojo new property(like using mixins or @jsonproperty) , modified pojo ? (a way add/modify field of pojo dynamically ?)

like have class

 class pojoa<t>{   private t data;//field modified newdata   } 

so, tried mixins like

    public interface pojomixin<t> {     @jsonproperty("newdata")      t getdata();      } 

now modified field, use objectmapper

        mapper.addmixinannotations(pojoa.class,pojomixin.class);         mapper.writerwithdefaultprettyprinter().writevalueasstring(pojoa); 

the actual result string, can able modified pojo?


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -