XStream でのXMLの attribute は、@XStreamAsAttribute を付けるだけ
import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAsAttribute; import lombok.Data; @XStreamAlias("ball") @Data public class Ball{ @XStreamAsAttribute private int size; }
<ball size="127"/>