|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bankframe.validation.DateValidator
public class 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(Date dateOrTime1,
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(Date date1,
Date date2)
This method compares the day month year portion of the dates ignoring the hours minutes and seconds. |
static int |
compareTimeOnly(Time time1,
Time time2)
This method the compares hours minutes and seconds portion of the times ignoring the days months years. |
static boolean |
isValid(String pattern,
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(Date dateOrTime1,
Date dateOrTime2)
throws ValidationException
ValidationException - if input data null or empty
public static boolean isValid(String pattern,
String dateOrTime)
throws ValidationException
pattern - accepted format of date/timedateOrTime - date/time String to be checked
ValidationException - if input data null or empty
public static int compareDateOnly(Date date1,
Date date2)
throws ValidationException
ValidationException - if input data null or empty
public static int compareTimeOnly(Time time1,
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 | |||||||||