|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bankframe.validation.DateValidator
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 |
public static final int BEFORE
public static final int AFTER
public static final int EQUAL
Constructor Detail |
public DateValidator()
Method Detail |
public static int compare(java.util.Date dateOrTime1, java.util.Date dateOrTime2) throws ValidationException
ValidationException
- if input data null or emptypublic static boolean isValid(java.lang.String pattern, java.lang.String dateOrTime) throws ValidationException
pattern
- accepted format of date/timedateOrTime
- date/time String to be checked
ValidationException
- if input data null or emptypublic static int compareDateOnly(java.util.Date date1, java.util.Date date2) throws ValidationException
ValidationException
- if input data null or emptypublic static int compareTimeOnly(java.sql.Time time1, java.sql.Time time2) throws ValidationException
ValidationException
- if input data null or empty
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |