Hi Will,
could you please open a new issue in jira and attach your diff to it. If
possible we would prefer if your diff would be in unified format (diff -u).
Having said that there may also be users that count on the case
sensitivite of the enumerated values. Therefore I think your patch will
not make it into CVS as is. What do you think of making this feature
configurable from the command line with default being case sensitive.
Regards
Ralf
Castor JDO, committer
Will McKinley schrieb:
> Hi.
>
> I'm new to Castor, but one of the features that I thought would be
> useful would be to generate code for Enumerated types based on a case
> insensitive lookup. This would allow value translation from "monday" to
> "Monday" so that the correct value is sent no matter how the user passed
> it into the type class.
>
> I have modified org.exolab.castor.builder.SourceFactory locally. I have
> included the diff here.
>
>> 1707a1708,1713
>> >
>> > /**
>> > * wml - 12/22/2005
>> > * Modifying the following line to perform lookups in a case
>> insensitive
>> > * manner.
>> > *
>> 1708a1715,1723
>> > */
>> > /*
>> > * Begin new code.
>> > */
>> > jsc.append( "obj = _memberTable.get( string.toLowerCase()
>> );" );
>> > /**
>> > * End new code.
>> > */
>> >
>> 1821a1837,1841
>> > /**
>> > * wlm - 12/22/2005
>> > * Modifying the following code section to allow case
>> insensitive
>> > * lookup of enumeration values.
>> > *
>> 1829a1850,1865
>> > */
>> > /**
>> > * Begin new code.
>> > */
>> > if ( addInitializerCode )
>> > {
>> > jsc = mInit.getSourceCode();
>> > jsc.add( "members.put( " );
>> > jsc.append( objName );
>> > jsc.append( ".toString().toLowerCase(), " );
>> > jsc.append( objName );
>> > jsc.append( " );" );
>> > }
>> > /**
>> > * End new code.
>> > */
>
>
>
> Regards,
> Will McKinley
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please send an empty message
> to the following address:
>
> [EMAIL PROTECTED]
> -------------------------------------------------
--
Syscon Ingenieurbüro für
Meß- und Datentechnik GmbH
Ralf Joachim
Raiffeisenstraße 11
D-72127 Kusterdingen
Germany
Tel. +49 7071 3690 52
Mobil: +49 173 9630135
Fax +49 7071 3690 98
Email: [EMAIL PROTECTED]
Web: www.syscon-world.de
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------