Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Felix Gerber for Jackson XML: nested field deserialization

My idea is to replace occupation with an own class. Something like myMeta or whatever you want to call it(be aware in your case like the xml says: meta). This class should cotain the field occupation:

   public class Meta   {       private String occupation;   }

After that you only have to add a new field of your new class e.g. myMeta to myPojo. Something like this:

   public class MyPojo   {       private String name;       private int age;       private Meta meta;   }

this should avoid

that occupation is wrapped within meta element

Hope that helps!


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>