Details
-
Type: Improvement
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2.2
-
Component/s: None
-
Labels:None
-
JDK version and platform:1.5
Description
Hello,
I was trying to map an XML file with multiple collections that must mapped as implicit collections.
I would like to map them using Java 5 annotations, but at the class level I can use a single @XStreamImplicitCollection having a single String parameter for the collection. Don't know if I missed something, or if I'm using the wrong approach. Please let me know if I'm in the latter case.
At present, for having things working, I modified XStreamImplicitCollection.java and Annotation.java sources for having an array of parameters. So I can map multiple collection writing the following code:
@XStreamAlias("Widget")
@XStreamImplicitCollection(
)
public class Widget {
private String Name;
private List<Property> properties = new ArrayList<Property>();
private List<Container> containers = new ArrayList<Container>();
}
I attached the modified sources and the diff file. Hope this can help.
Hi Lucio,
the problem with this modification is, that it breaks backward compatibility. Nevertheless, we were discussing internally about this annotation anyway, since we have the impression, it should be assigned to a field and not to a class.
... we'll see ...