admin@glassfish.java.net

Re: Question for Remote Command Developers

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Tue, 08 Apr 2008 12:25:07 -0700

Bill Shannon wrote:
> Jerome Dochez wrote:
>>
>> On Apr 8, 2008, at 7:43 AM, Prashanth Abbagani wrote:
>>> This will be useful. But for boolean parameters, can we encourage
>>> the developers to declare the param as boolean type (as against
>>> String), and you implicitly validate the option value for (true or
>>> false).
>>>
>> right, I like the feature but not the example...
>>
>> we should have
>> @Param(optional=true)
>> Boolean enabled
>>
>> and let the system figure out the conversion (constructor with String
>> paramerter).
>>
>> having said that, the acceptableValues is interesting for other
>> things, and could/ should be enhanced to support range :
>> like
>> @Param(acceptableValues="0..100")
>> Integer numberOfThreads;
>
> Shouldn't we use the Bean Validation spec (JSR-303) to do this?
>
> Also, didn't we used to accept a bunch of values for boolean attributes
> (true, false, on, off, yes, no, 1, 0)? Not that I think that's a good
> idea, I'm just worried about compatibility.
>
>
No -- in 9.x :

no value --> true
case-insensitive "true" --> true
case-insensitive "false" --> false
anything else --> Error: "CLI015 Invalid value for echo. Option
accepts true or false."
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>

-- 
Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.