JAXB inheritance + element rename

medvedic

New Member
I have the following construction:\[code\]@XMLTransientpublic abstract class Foo { protected String name;}@XmlRootElement@XmlType(propOrder={"name"})public class BarX extends Foo { public String getXThing() { return name; } public void setXThing(String thing) { name = thing; }}@XmlRootElement@XmlType(propOrder={"name"})public class BarY extends Foo { public String getYBlah() { return name; } public void setYBlah(String blah) { name = blah; }}\[/code\]Within the XML I need for BarX instead of \[code\]name\[/code\] the tag \[code\]thing\[/code\] and for BarY I would like to have \[code\]blah\[/code\] instead of \[code\]name\[/code\]. Is it possible and how I can get this?Thanks a lot,Andre
 
Back
Top