|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectproject35.soa.validation.AbstractEditFieldValidationService
project35.soa.validation.DateValidator
public class DateValidator
In Project35, the user can establish which format they want to use to express date values. These formats are supported:
Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.
| Field Summary | |
|---|---|
static SimpleDateFormat |
canonicalFormat
format used to read/write date values from file |
static SimpleDateFormat |
ddmmyyyyFormat
indicates DD/MM/YYYY format |
static SimpleDateFormat |
mmddyyyyFormat
indicates MM/DD/YYYY format |
static SimpleDateFormat |
yyyymmddFormat
indicates YYYY/MM/DD format |
| Fields inherited from class project35.soa.validation.AbstractEditFieldValidationService |
|---|
collator |
| Constructor Summary | |
|---|---|
DateValidator()
|
|
| Method Summary | |
|---|---|
static Date |
getCanonicalDate(String date)
string date |
static SimpleDateFormat |
getCanonicalFormat()
|
static String |
getCanonicalValue(Date date)
|
static Date |
getDate(String date)
|
static SimpleDateFormat |
getDateFormat()
gets the current date format |
static String |
getDateFormatString(SimpleDateFormat format)
|
static String |
getDateValue(Date date)
a date |
static void |
setDateFormat(SimpleDateFormat format)
sets the date format used to do validation |
static void |
setDefaultDateFormat()
sets date format to ddmmyyyy format |
ArrayList |
validate(Project35FormContext project35FormContext,
String value)
assumes that the string value passed to it will always be written in a canonical form. |
| Methods inherited from class project35.soa.validation.AbstractEditFieldValidationService |
|---|
getFieldName, getInitialisationParameters, initialiseService, isEmpty, isFieldRequired, setFieldName, setRequiredField, validateRequiredField |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleDateFormat canonicalFormat
public static final SimpleDateFormat ddmmyyyyFormat
public static final SimpleDateFormat mmddyyyyFormat
public static final SimpleDateFormat yyyymmddFormat
| Constructor Detail |
|---|
public DateValidator()
| Method Detail |
|---|
public static Date getCanonicalDate(String date)
public static SimpleDateFormat getCanonicalFormat()
public static SimpleDateFormat getDateFormat()
public static String getDateFormatString(SimpleDateFormat format)
format - returns the pattern corresponding to the
date format
public static String getCanonicalValue(Date date)
date - a date object
public static Date getDate(String date)
date - string representation of a date
public static String getDateValue(Date date)
public static void setDateFormat(SimpleDateFormat format)
format - the new date format used for validationpublic static void setDefaultDateFormat()
public ArrayList validate(Project35FormContext project35FormContext,
String value)
validate in interface EditFieldValidationServicevalidate in class AbstractEditFieldValidationServicevalue - the value of the field
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||