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
-
Activity
| Field | Original Value | New Value |
|---|---|---|
| issue.field.bugzillaimportkey | 1854 | 23298 |
| Assignee | Keith Visco [ kvisco ] |
| Link |
This issue duplicates |
| Fix Version/s | 1.1.1 [ 13080 ] | |
| Assignee | Ralf Joachim [ rjoachim ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Duplicate [ 3 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
| Resolution | Duplicate [ 3 ] | |
| Assignee | Ralf Joachim [ rjoachim ] | Werner Guttmann [ wguttmn ] |
| Status | Closed [ 6 ] | Reopened [ 4 ] |
| Fix Version/s | 1.1.2 [ 13440 ] | |
| Fix Version/s | 1.1.1 [ 13080 ] |
| Attachment | patch.c991.20070526.txt [ 27610 ] |
| Status | Reopened [ 4 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Created an attachment (id=856)
proposed patch
The patch is based on the .9.6 cvs version