com.bankframe.validation
Class DateValidator

java.lang.Object
  extended bycom.bankframe.validation.DateValidator

public class DateValidator
extends java.lang.Object

The DateValidator class is used for validating date and time strings. It does this by using the java.util.Date and java.util.SimpleDateFormat classes.


Field Summary
static int AFTER
           
static int BEFORE
           
static int EQUAL
           
 
Constructor Summary
DateValidator()
           
 
Method Summary
static int compare(java.util.Date dateOrTime1, java.util.Date dateOrTime2)
          This method allows you to compare date objects param dateOrTime1 Date the first date/time object param dateOrTime2 Date the date/time object to compare the first date/time object to
static int compareDateOnly(java.util.Date date1, java.util.Date date2)
          This method compares the day month year portion of the dates ignoring the hours minutes and seconds.
static int compareTimeOnly(java.sql.Time time1, java.sql.Time time2)
          This method the compares hours minutes and seconds portion of the times ignoring the days months years.
static boolean isValid(java.lang.String pattern, java.lang.String dateOrTime)
          Validates date or time string against an accepted pattern
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEFORE

public static final int BEFORE
See Also:
Constant Field Values

AFTER

public static final int AFTER
See Also:
Constant Field Values

EQUAL

public static final int EQUAL
See Also:
Constant Field Values
Constructor Detail

DateValidator

public DateValidator()
Method Detail

compare

public static int compare(java.util.Date dateOrTime1,
                          java.util.Date dateOrTime2)
                   throws ValidationException
This method allows you to compare date objects param dateOrTime1 Date the first date/time object param dateOrTime2 Date the date/time object to compare the first date/time object to

Returns:
int
Throws:
ValidationException - if input data null or empty

isValid

public static boolean isValid(java.lang.String pattern,
                              java.lang.String dateOrTime)
                       throws ValidationException
Validates date or time string against an accepted pattern

Parameters:
pattern - accepted format of date/time
dateOrTime - date/time String to be checked
Returns:
boolean
Throws:
ValidationException - if input data null or empty

compareDateOnly

public static int compareDateOnly(java.util.Date date1,
                                  java.util.Date date2)
                           throws ValidationException
This method compares the day month year portion of the dates ignoring the hours minutes and seconds. param date1 Date the first date object param date2 Date the date object to compare the first date object to

Returns:
int
Throws:
ValidationException - if input data null or empty

compareTimeOnly

public static int compareTimeOnly(java.sql.Time time1,
                                  java.sql.Time time2)
                           throws ValidationException
This method the compares hours minutes and seconds portion of the times ignoring the days months years. param time1 Time the first time object param time2 Time the time object to compare the first time object to

Returns:
int
Throws:
ValidationException - if input data null or empty


Copyright © 2004 Siebel Systems, Inc. All rights reserved.