Reputation: 424
Setter method is not generated when i create JAX classes from XSD,for maxOccurs=unbounded type. I need to manually add setter method for DetailType
.Is this the right approach since i need to populate DetailType inside the root element
@XmlRootElement(name = "WPExchangeRate")
public class WPExchangeRate {
@XmlElement(name = "Header")
protected HeaderType header;
@XmlElement(name = "Detail", required = true)
protected List<DetailType> detail;
@XmlElement(name = "Trailer")
protected TrailerType trailer;
Upvotes: 0
Views: 530
Reputation: 16
If you are using Maven:
In your pom.xml
add to the plugin's <configuration>
:
<args>
<arg>-Xsetters</arg>
</args>
If you want to configure generation method: -Xsetters-mode=accessor
or -Xsetters-mode=direct
.
If you are generating from command line:
Add -Xsetters
to the command (same for -Xsetters-mode
).
Upvotes: 0