I am using JAXB to generate java classes based on some XSD schemas. For an element such as:
<xsd:element name="REC_LOC" type="xsd:string" minOccurs="1"/>
jaxb generates the following code:
@XmlElement(name = "REC_LOC", required = true)
protected String recloc;
public String getRECLOC() {
return recloc;
}
/**
* Sets the value of the recloc property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRECLOC(String value) {
this.recloc = value;
}
The problem is that we need to use some proprietary XML tools that rely on the naming convention of the getter/setter methods. For example, for the field REC_LOC they expect methods called getRecLoc(String value) and setRecLoc(), instead of getRECLOC().
Is there any way to customise the method names generated by jaxb?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…