http://stackoverflow.com/questions/3422545/binding-a-generic-java-class-to-a-json-using-jaxb
xml
/**
*
*/
package com.unism.model;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlSeeAlso(PMRoleVO.class)
public class Podcast<T> implements Serializable {
private static final long serialVersionUID = -8039686696076337053L;
@XmlElement(name = "id")
private Long id;
@XmlElement(name = "title")
private String title;
@XmlElement(name = "linkOnPodcastpedia")
private String linkOnPodcastpedia;
@XmlElement(name = "feed")
private String feed;
@XmlElement(name = "description")
private T description;
public Podcast(String title, String linkOnPodcastpedia, String feed, T description) {
this.title = title;
this.linkOnPodcastpedia = linkOnPodcastpedia;
this.feed = feed;
this.description = description;
}
public Podcast() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getLinkOnPodcastpedia() {
return linkOnPodcastpedia;
}
public void setLinkOnPodcastpedia(String linkOnPodcastpedia) {
this.linkOnPodcastpedia = linkOnPodcastpedia;
}
public String getFeed() {
return feed;
}
public void setFeed(String feed) {
this.feed = feed;
}
public T getDescription() {
return description;
}
public void setDescription(T description) {
this.description = description;
}
}