We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
@XmlRootElement(name = "apple") public static class Apple {
private String name;
public Apple() {
}
public Apple(String n) { name = n; }
public void setName(String n) { name = n; }
public String getName() { return name; }
@XmlRootElement(name = "response") @XmlSeeAlso( {Apple.class}
) public static class CRUDResponse {
private int total = 1; private List entityList;
public CRUDResponse() {
public CRUDResponse(T entity) { entityList = new ArrayList(); entityList.add(entity); }
public void setEntityList(List list) { entityList = list; }
public List getEntityList() { return entityList; }
public void setTotal(int num) { total = num; }
public int getTotal() { return total; }
serializing new CRUDResponse(new Apple("golden delicious")) with an array key pointing to 'entity list' and a namespace map being set to
Map<String, String> namespaceMap = new HashMap<String, String>(); namespaceMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
produces :
{"entityList": {"@xsi.type":"apple","name":"golden delicious"}
,"total":1}
Wrapping a jettison writer with a custom one which blocks the attributes produces the correct output :
{"entityList":[ {"name":"golden delicious"}
],"total":1}
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: