Я пытаюсь создать файл XML, используя JAXB для отображения productCode, productGroup, tradedUnitEA и tradedUnitDUN, но первое свойство productCode не отображается в файле
Я использую JAXB версии 2.2.11
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"productCode",
"productGroup",
"tradedUnitEAN",
"tradedUnitDUN"
})
public class Product {
@XmlElement(name = "ProductCode", required = true)
protected String productCode;
@XmlElement(name = "ProductGroup", required = true)
protected String productGroup;
@XmlElement(name = "TradedUnitEAN", required = true)
protected String tradedUnitEAN;
@XmlElement(name = "TradedUnitDUN", required = true)
protected String tradedUnitDUN;
public Product() {
}
public Product(String productCode, String productGroup, String tradedUnitEAN, String tradedUnitDUN) {
this.productCode = productCode;
this.productGroup = productGroup;
this.tradedUnitEAN = tradedUnitEAN;
this.tradedUnitDUN = tradedUnitDUN;
}
/**
* Gets the value of the productCode property.
*
* @return possible object is
* {@link String }
*/
public String getProductCode() {
return productCode;
}
/**
* Sets the value of the productCode property.
*
* @param value allowed object is
* {@link String }
*/
public void setProductCode(String value) {
this.productCode = value;
}
/**
* Gets the value of the productGroup property.
*
* @return possible object is
* {@link String }
*/
public String getProductGroup() {
return productGroup;
}
/**
* Sets the value of the productGroup property.
*
* @param value allowed object is
* {@link String }
*/
public void setProductGroup(String value) {
this.productGroup = value;
}
/**
* Gets the value of the tradedUnitEAN property.
*
* @return possible object is
* {@link String }
*/
public String getTradedUnitEAN() {
return tradedUnitEAN;
}
/**
* Sets the value of the tradedUnitEAN property.
*
* @param value allowed object is
* {@link String }
*/
public void setTradedUnitEAN(String value) {
this.tradedUnitEAN = value;
}
/**
* Gets the value of the tradedUnitDUN property.
*
* @return possible object is
* {@link String }
*/
public String getTradedUnitDUN() {
return tradedUnitDUN;
}
/**
* Sets the value of the tradedUnitDUN property.
*
* @param value allowed object is
* {@link String }
*/
public void setTradedUnitDUN(String value) {
this.tradedUnitDUN = value;
}
}
Вот внешний вид XML-файла без productCode