Details
Description
I tried to unmarshall XML data for a class SimpleMessage that has a constructor with two parameters. The type of the second parameter is an enum-like class Severity (without a valueOf() method). Now, there seems to be a problem, when unmarshalling data.
sample data:
<SimpleMessage severity="Warning" text="marked object as obsolete"/>
<SimpleMessage severity="Error" text="must shut down system">
The following mapping was used:
<mapping>
<class name="sample.SimpleMessage" verify-constructable="false">
<map-to xml="SimpleMessage" />
<field name="severity" type="sample.Severity" get-method="severity" set-method="%2" handler="sample.SeverityHandler">
<bind-xml name="severity" node="attribute"/>
</field>
<field name="formattedText" type="java.lang.String" get-method="formattedText" set-method="%1" >
<bind-xml name="text" node="attribute"/>
</field>
</class>
</mapping>
The code for the domain classes, the handler, the mapping and a test case is attached.
Maybe I'm just missing something?
How about attaching the Severity class as well, as it's being referenced ?