Im Java-Klassen aus einer XSD-Datei erstellt wird dies mit xjc Skriptxjc Java-Klassen-Generation, wo die Felder den gleichen Namen haben wie @XmlElement
for %%f in (*.xsd) do (
xjc -no-header %%f
)
pause
es Klassen generiert, die diese aussehen
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AppData1", propOrder = {
"appInstllCd",
"appVrsn",
"os",
"osVrsn",
"device"
})
public class AppData1 {
@XmlElement(name = "AppInstllCd")
protected String appInstllCd;
@XmlElement(name = "AppVrsn")
protected String appVrsn;
@XmlElement(name = "OS")
protected String os;
@XmlElement(name = "OSVrsn")
protected String osVrsn;
@XmlElement(name = "Device")
protected String device;
/**
* Gets the value of the appInstllCd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAppInstllCd() {
return appInstllCd;
}
/**
* Sets the value of the appInstllCd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAppInstllCd(String value) {
this.appInstllCd = value;
}
/**
* Gets the value of the appVrsn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAppVrsn() {
return appVrsn;
}
/**
* Sets the value of the appVrsn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAppVrsn(String value) {
this.appVrsn = value;
}
/**
* Gets the value of the os property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getOS() {
return os;
}
/**
* Sets the value of the os property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setOS(String value) {
this.os = value;
}
/**
* Gets the value of the osVrsn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getOSVrsn() {
return osVrsn;
}
/**
* Sets the value of the osVrsn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setOSVrsn(String value) {
this.osVrsn = value;
}
/**
* Gets the value of the device property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDevice() {
return device;
}
/**
* Sets the value of the device property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDevice(String value) {
this.device = value;
}
}
ich möchte wissen, ob ich mein Skript irgendwie ändern kann, dass meine Klassenfelder haben den gleichen Namen macht, dass die @XmlElement
hat, zum Beispiel wäre das Ergebnis:
@XmlElement(name = "AppInstllCd")
protected String AppInstllCd;
@XmlElement(name = "AppVrsn")
protected String AppVrsn;
@XmlElement(name = "OS")
protected String OS;
@XmlElement(name = "OSVrsn")
protected String OSVrsn;
@XmlElement(name = "Device")
protected String Device;