Reputation: 866
After upgrading Xstream to 1.4.8 I noticed that XstreamConverter
and XstreamRepresentation
were deprecated.
Two questions:
xstream annotations
?The annotations I currently use are:
How can I achieve XML formatted response using Jackson?
Upvotes: 1
Views: 867
Reputation: 866
We plan to keep only the Jackson extension which handles several formats, mainly for the sake of simplicity. This removal is planned for release 3.0 of the framework.
Could you send us the kind of annotations you are using? we can help you to find substitute. If your are using the XStreamAlias annotation at the class level, use the JacksonXmlRootElement annotation. If your are using the XStreamAlias and the XStreamAsAttribute annotation at the property level, use the JacksonXmlProperty annotation. For example:
@JacksonXmlRootElement(localName = "MyContact")
public class Contact {
@JacksonXmlProperty(localName = "firstName")
private String name;
@JacksonXmlProperty(isAttribute = true)
private String attr;
public String getAttr() {
return attr;
}
public void setAttr(String attr) {
this.attr = attr;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Here is a page that describes all annotations dedicated to XML transformations: https://github.com/FasterXML/jackson-annotations/wiki/Jackson-Annotations
Having said that, it is still possible to keep the xstream extension in your own code, even in the future, while the API of the 3.0 version of the is compatible with the one used by your version of the xstream extension.
Upvotes: 1