Details
Description
I need to support Java5 Enum without defining a mapping.
I tried to do this with Descriptors Handlers and it never worked out.
After a lots of struggle I decided to treat it as a primitive and that was very
easy todo than.
I will upload the patch.diff file for CVS. Please integrate this as I need it
very much.
Or if you do not like the approach implement the java5 enum support in any way
you like.
The approach is very simply. There are 2 isPrimitive methods
(Introspector,MarshalFramework).
I intruduced the following check for enum:
type.getSuperclass().getName().equals("java.lang.Enum")
On the marshalling point for primitives I do the same check again and if it is
an enum, I call the 'name' method.
On the Unmarshalling point I do the same as your EnumFieldHandler, I call the
valueOf method.
Issue Links
- duplicates
-
CASTOR-1221
JDK 1.5 enum are not marshalled
-
Created an attachment (id=856)
proposed patch
The patch is based on the .9.6 cvs version