jaxws wsimport generates pojo java classes from wsdl using a
@XmlElement(name="{name}", ...) annotation. The following custom naming
strategy uses this annotation:
/**
* XmlElement annotation to get the field name
* @XmlElement(name = "{name}")
*/
public class XmlElementFieldNamingPolicy implements FieldNamingStrategy {
/**
* @param f field
* @return name of XmlElement annotation if field has XmlElement annotation
*/
@Override
public String translateName(Field f) {
XmlElement v_annotation = f.getAnnotation(XmlElement.class);
return v_annotation != null ? v_annotation.name() : f.getName();
}
}
Original issue reported on code.google.com by mbreuer....@googlemail.com on 25 Mar 2013 at 9:51
Original issue reported on code.google.com by
mbreuer....@googlemail.com
on 25 Mar 2013 at 9:51