java - Map Jackson XML attribute to corresponding JSON element -
i using jackson xmlmapper deserialize xml pojo. using objectmapper serialize json.
i'd set json key value using xml attribute value. appreciated. thanks.
example xml:
<response>   <label data="somevalue" /> </response> needs map json as:
{   "response" : {    "label" : "somevalue"    } } this can right now:
{   "response" : {     "label" : {       "data" : "somevalue"     }   } } this pojo label element:
@jsonignoreproperties(ignoreunknown=true) public class labelobject {    @jacksonxmlproperty(localname = "data", isattribute = true)   private string data;    // getter setter }  
 
  
Comments
Post a Comment