Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.4.2
-
Fix Version/s: 1.4.2
-
Component/s: Annotations
-
Labels:None
-
JDK version and platform:Sun 1.6.0_27 for Mac O/S 10 & Windows
Description
Annotating a class with @XStreamAlias("event") fails to map to the class when mapping from XML to POJO.
So for a class:
@XStreamAlias("event")
public final class AuditEventURL
...
executing:
xstream.fromXML(xml);
results in <ws.cogito.auditing.model.AuditEventURL> rather than <event>.
The work around is to configure xstream engine with an alias:
xstream.alias("event", AuditEventURL.class);
results in <event>
But I would think this is redundant given the annotation.
I meant to say in my posting that executing xstream.fromXML(xml) fails unless I pass in <ws.cogito.auditing.model.AuditEventURL>. But I thought the annotation would allow me pass in <event> instead. The work around is to add an alias to the engine which helps resolve <event> to AuditEventURL POJO.