AFAIK, the strings are only used in UIInput.validate. Translating them
to enums for only one or two comparisons in that method doesn't sound
very useful to me...
But, on the other hand, I also don't see why it can't be added since
the strings are only used internally in the API classes.
Matthias, what kind of enum are you thinking about? Something like
this? (pseudocode)
enum {
AUTO("auto")
TRUE("true")
FALSE("false")
String ctxParam;
valueOf(String str) {
if ("auto".equals(str)) return AUTO;
else if ("trur".equals(str)) return TRUE;
else if ("false".equals(str)) return FALSE;
}
}
I think something like this can be easily added without b/w
compatibility issues. But I don't see any real advantages.
/JK
2009/12/10 Kito Mann <kito.mann_at_virtua.com>:
> Hello Matthias,
>
> Isn't this supposed to be a context parameter, though? Aren't context
> parameters always Strings?
> ---
> Kito D. Mann | twitter: kito99 | Author, JSF in Action
> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting
> http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info | twitter:
> jsfcentral
> +1 203-404-4848 x3
>
> JSF Summit Conference Dec 1st-4th in Orlando: http://www.jsfsummit.com
>
>
>
> On Wed, Dec 2, 2009 at 2:47 AM, Matthias Wessendorf <matzew_at_apache.org>
> wrote:
>>
>> On a related conversation, I spoke with Blake Sullivan (Oracle) about
>> this.
>> He agrees that it should have been an Enum.
>>
>> However, he also said that it maybe too late, because the change
>> wouldn't be backwards compatible...
>>
>> Greetings,
>> Matthias
>>
>> On Tue, Dec 1, 2009 at 3:44 PM, Matthias Wessendorf <matzew_at_apache.org>
>> wrote:
>> > Hello,
>> >
>> > reading http://bit.ly/8eFADF regarding
>> > "VALIDATE_EMPTY_FIELDS_PARAM_NAME", I saw all the Strings, like
>> > “auto”
>> > "true"
>> > "false"
>> >
>> > I wonder if we should have an Enum for that... ?
>> >
>> > -Matthias
>> >
>> >
>> > --
>> > Matthias Wessendorf
>> >
>> > blog: http://matthiaswessendorf.wordpress.com/
>> > sessions: http://www.slideshare.net/mwessendorf
>> > twitter: http://twitter.com/mwessendorf
>> >
>>
>>
>>
>> --
>> Matthias Wessendorf
>>
>> blog: http://matthiaswessendorf.wordpress.com/
>> sessions: http://www.slideshare.net/mwessendorf
>> twitter: http://twitter.com/mwessendorf
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>
>
>