marshalling - using JAXB, the XML is loaded into a class. This class is then used within another class to be marshalled out differently -



marshalling - using JAXB, the XML is loaded into a class. This class is then used within another class to be marshalled out differently -

given xml file of offerings loaded class called offerings via jaxb.

this class has following: name, cost sub-class, modifiers, ordering rules etc.

i create order , within order

order

public class productorder { private string orderid; private date createdate; private orderstatus orderstatus; private int customerorderid; private arraylist<productorderitem> productorderitems = new arraylist<productorderitem>(); }

order item

public class productorderitem { private int orderitemid; private **offering** offering; private map<string, integer> qtylist = new hashmap<string, integer>(); private arraylist<modifier> modifiers = new arraylist<modifier>(); private int qty; }

offering

@xmlrootelement(name = "offering") @xmlaccessortype(xmlaccesstype.field) // none) public class offering { @xmlattribute private string id; @xmlelement private string offeringname; @xmlelement private string description; @xmlelement private integer price; }

the offering , modifiers classes jaxb want force part of xml. how alter anotations such part of elements sent? illustration not offering -> modifiers?

use @xmltransient instead of @xmlelement tag.

jaxb marshalling unmarshalling

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -