java - failed to unmarshall using JAXB -
so, have jaxbcontext
jaxbcontext context = jaxbcontext.newinstance(foo.class);
referring documentation,
if newinstance(foo.class), newly created jaxbcontext} recognize both foo , bar, not foobar
class foo { @xmltransient foobar c; bar b; }
problem is, when try unmarshall xml foo, like:
unmarshaller unmarshaller = context.createunmarshaller(); object obj = unmarshaller.unmarshal(xmlstring);
xmlstring representation of foo, unmarshaller fails deliver obj instanceof foo, instead delivers bar instance. (i made simple, problem arises when context knows 5-6 classes)
any appreciated!
Comments
Post a Comment