Not sure if the name makes sense. I have an object that I want to make using JAXB, which looks like this:
@XmlRootElement(name = "subscriptionRequest")
public class RegistrationRequest {
private Long id;
private RegistrationSource registrationSource;
}
RegistrationSource Object:
public class RegistrationSource {
private Integer id;
private String code;
}
I want to create an xml that has the following layout:
<subscriptionRequest registrationSource="0002">
...
</subscriptionRequest>
where the value of the registrationSource attribute is the value of the code field from the RegistrationSource object.
What XML annotations do I need to use?
source
share