commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: Commons validator
Date Fri, 29 Aug 2008 13:14:41 GMT
On Fri, Aug 29, 2008 at 5:36 AM, Vinay Binny <vinaybinny1@gmail.com> wrote:
> Hi all,
>
> I see a compareDates method in the DateValidator class of the routine
> package, I was wondering if I could use it directly in my
> validator-rules.xml by specifying something like:
>
> <validator name="compareDate"
>
> classname="org.apache.commons.validator.DateValidator"
>
> method="compareDates"
> but I had no luck figuring out how to di it.
>
> OR
>
> Should I be using these routine classes to develop a custom validation rule?

You need to develop a custom routine since that method (and other
similar ones) return an integer representing equal, less than and
greater than in the same style as the Comparator implementations:

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html

So this could be used to develop validation rules for less than, less
than or equal, equal, greater than, greater than or equal

Niall

> Thanks,
>
> Vinay.

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


Mime
View raw message