java - Change element name of a JAXB annotated subclass -


i trying create jaxb class hierarchy web services domain. find inconvenient subclass overrides getter method in super class can change element name jaxb outputs, super class's 1 being written output. wondering if there way suppress getter in super class.

code:

@xmltype class superclass {     @xmlelement(name = "name")     public string getname(){} }  @xmltype class subclass extends superclass {     @override     @xmlelement(name = "coolname")     public string getname(){} } 

when add subclass element xmlrootelement, output xml contains 2 elements, <name> , <coolname>. there way suppress <name> being marshaled ?

do need have name property on superclass mapped? if not mark property @xmltransient.

class superclass {     @xmltransient     public string getname(){} } 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -