You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2005/01/21 02:18:45 UTC

Re: [lang] lang.Validate

The Validate class is intended to be used to validate entry to methods at 
runtime, similar to the assert keyword in JDK1.4. It is not intended to be a 
general purpose validation class.


> What I'm wondering is, are there are any plans to increase the scope of 
> Validate's tests?  And if there aren't any such plans, would the 
> maintainers be open to someone else (me, for example) submitting patches 
> that expand the functionality of Validate?

There are no plans at present. Specific ideas are welcomed, as are patches. 
Patches should be submitted to bugzilla with test cases using the correct 
patch format (see pages on website)


> I can think of quite a few tests that could be standardized by Validate. 
> For example:
> A regex matching test; Validate.matches(param, "[1-9][0-9]*");
> A numerical range test; Validate.inRange(param, new IntRange(0, null));
> A test for asserting a predicate over an array collection:
> Validate.forAll(myList, myPredicate);
> Even a simple nonNegative test for the integral and floating point 
> primitives would be great.

Any enhancement suggestions will be judged based on whether they fit the 
intent of the class, and whether they are JDK1.2 compatible (regexp isn't 
for example).

Of your suggestions, I believe that numeric range validations could probably 
be added, but regexp and predicate based classes would not.

I also suggest discussing particular proposals before going to the effort of 
implementation.

Hope this helps.
Stephen




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [lang] lang.Validate

Posted by Stephen Colebourne <sc...@btopenworld.com>.
> Thanks for the response.  Where is the proper place to discuss such a
proposal?  The commons-dev list?

Yes, for proposed code changes commons-dev is better.
commons-user is for usage queries.

Stephen

----- Original Message ----- 
From: "Briniest Mark" <ma...@telus.net>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Friday, January 21, 2005 2:32 AM
Subject: Re: [lang] lang.Validate




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [lang] lang.Validate

Posted by Briniest Mark <ma...@telus.net>.
Stephen Colebourne wrote:

> The Validate class is intended to be used to validate entry to methods
> at runtime, similar to the assert keyword in JDK1.4. It is not
> intended to be a general purpose validation class.
>
>
>> What I'm wondering is, are there are any plans to increase the scope
>> of Validate's tests?  And if there aren't any such plans, would the
>> maintainers be open to someone else (me, for example) submitting
>> patches that expand the functionality of Validate?
>
>
> There are no plans at present. Specific ideas are welcomed, as are
> patches. Patches should be submitted to bugzilla with test cases using
> the correct patch format (see pages on website)
>
>
>> I can think of quite a few tests that could be standardized by
>> Validate. For example:
>> A regex matching test; Validate.matches(param, "[1-9][0-9]*");
>> A numerical range test; Validate.inRange(param, new IntRange(0, null));
>> A test for asserting a predicate over an array collection:
>> Validate.forAll(myList, myPredicate);
>> Even a simple nonNegative test for the integral and floating point
>> primitives would be great.
>
>
> Any enhancement suggestions will be judged based on whether they fit
> the intent of the class, and whether they are JDK1.2 compatible
> (regexp isn't for example).
>
> Of your suggestions, I believe that numeric range validations could
> probably be added, but regexp and predicate based classes would not.
>
> I also suggest discussing particular proposals before going to the
> effort of implementation.
>
> Hope this helps.
> Stephen
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
Thanks for the response.  Where is the proper place to discuss such a
proposal?  The commons-dev list?


--
Mark Fairchild <md...@sfu.ca>
Learn Lisp today!  Uncle Turing wants you!