I am doing marshalling of java object to XML using JAXB . I had requirement to create some thing like
<link rel="self" href="test" />
How this can be done? what annotations should i use.
Any help will be greatly appriciated
Java Class
public class Item {
private String title;
private int price;
private String productLink;
private String rel;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
@XmlPath("link/@href")
public String getProductLink() {
return productLink;
}
public void setProductLink(String productLink) {
this.productLink = productLink;
}