Tuesday, 15 April 2014

java - How does unmarshalling work in JAXB? -



java - How does unmarshalling work in JAXB? -

i have getter/setter pair element in jaxb:

@xmlelementwrapper(name="requires", required=true) @xmlelement(name="equals", required=true) list<myobject> getmyobjects() { homecoming this.myobject; } void setmyobjects(final myobject... myobjects) { //call regular method setting objects //that not have required signature type }

the thing setter method never getting called. set breakpoint on both getter , setter, , 1 getter hit, not setter's.

i found this question, don't understand answer. myobjects initialized @ construction time, looks fits scenario 2. happens in unmarshalling process after getter called?

your setter doesn't match signature of getter. instead of:

void setmyobjects(final myobject... myobjects)

you need

void setmyobjects(list <myobject> myobjects)

java jaxb

No comments:

Post a Comment