Glad to see its already being worked.   :)

And it may be easier then I intially thought. enums have the
valueOf(String) method, and of course the toString() method. So
basically my object methods will call on these two to both set the
value of the enum from a string and get its value. Castor wont know
any different and think it's working with strings.

I'm not sure how else you would store an ENUM in a database besides
its string representation. The only thing that might make it easier
for the end user is just having two methods:
void setEnumType(String)
<enum> getEnumType()   //this is where castor will obviously have to change

-Nick


On 5/11/05, Andrew Fawcett <[EMAIL PROTECTED]> wrote:
> Hi Nick,
> 
> As it happens I've just started down this road with Castor XML. The
> first stage to teach the Castor Java source API about the new Java 5
> features is almost completed.
> http://jira.codehaus.org/browse/CASTOR-1104
> 
> As regards your current approach, yes you may well be able to emulate
> the current generated enum classes by adding enum methods to your enum
> constants. Please let us know how you get on.
> 
> Cheers,
> 
> Andy.
> 
> -----Original Message-----
> From: Nick Stuart [mailto:[EMAIL PROTECTED]
> Sent: 11 May 2005 00:23
> To: [email protected]
> Subject: [castor-dev] Java 5 Enums
> 
> Anyone have any ideas on how we might utilize the new Java 5 enumerator
> types? I really have no clear idea on how this might be achieved. I'm
> going to use enums in a new project, but I think I'll have a special
> function in the enum itself that will take a string/int or something and
> spit back the right value.
> 
> Right at the moment I cant see any clear way to use them otherwise.
> 
> -Nick
> 
> The information in this message is confidential and may be legally 
> privileged. It may not be disclosed to, or used by, anyone other than the 
> addressee. If you receive this message in error, please advise us 
> immediately.  Internet emails are not necessarily secure. CODA does not 
> accept responsibility for changes to any email which occur after the email 
> has been sent. Attachments to this email may contain software viruses, which 
> could damage your systems. CODA has checked the attachments for viruses 
> before sending, but you should virus-check them before opening.
> 
>

Reply via email to