java - Optional wrapper in Jaxb List -
i'm using jaxb map xml class. 1 of fields can have wrapper(optional), , wondering if there way of defining on class. xml can like:
... <fields> <field>value1</field> <field>value2</field> </fields> ...
or
... <field>value1</field> <field>value2</field> ...
so far, have tried code below seems work if wrapper element present:
@xmlelementwrapper(name = "fields") @xmlelement(name = "field") protected list<userfield> userfields;
any appreciated. also, using moxy use @xmlpath etc. if help. thanks
Comments
Post a Comment