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

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -