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.