Use lombok with @XmlElement
How can I use Lombok in conjunction with my @XmlElement
tags so that I can unmarshall the object?
I have about 20 properties, so I'm looking to not write an explicit getter and setter for each with the XmlElement
tags on the setters.
这完成了工作:
@Data
@XmlRootElement(name = "root")
@XmlAccessorType(XmlAccessType.FIELD) // UPDATE: Need this or else exception
public class Data {
@XmlElement(name = "test")
public double testData;
}
链接地址: http://www.djcxy.com/p/87354.html
上一篇: 代表中的协变性,任何示例?