|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object project35.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 java.text.SimpleDateFormat |
canonicalFormat
format used to read/write date values from file |
static java.text.SimpleDateFormat |
ddmmyyyyFormat
indicates DD/MM/YYYY format |
static java.text.SimpleDateFormat |
mmddyyyyFormat
indicates MM/DD/YYYY format |
static java.text.SimpleDateFormat |
yyyymmddFormat
indicates YYYY/MM/DD format |
Fields inherited from class project35.soa.validation.AbstractEditFieldValidationService |
---|
collator |
Constructor Summary | |
---|---|
DateValidator()
|
Method Summary | |
---|---|
static java.util.Date |
getCanonicalDate(java.lang.String date)
string date |
static java.text.SimpleDateFormat |
getCanonicalFormat()
|
static java.lang.String |
getCanonicalValue(java.util.Date date)
|
static java.util.Date |
getDate(java.lang.String date)
|
static java.text.SimpleDateFormat |
getDateFormat()
gets the current date format |
static java.lang.String |
getDateFormatString(java.text.SimpleDateFormat format)
|
static java.lang.String |
getDateValue(java.util.Date date)
a date |
static void |
setDateFormat(java.text.SimpleDateFormat format)
sets the date format used to do validation |
static void |
setDefaultDateFormat()
sets date format to ddmmyyyy format |
java.util.ArrayList |
validate(Project35FormContext project35FormContext,
java.lang.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 java.text.SimpleDateFormat canonicalFormat
public static final java.text.SimpleDateFormat ddmmyyyyFormat
public static final java.text.SimpleDateFormat mmddyyyyFormat
public static final java.text.SimpleDateFormat yyyymmddFormat
Constructor Detail |
---|
public DateValidator()
Method Detail |
---|
public static java.util.Date getCanonicalDate(java.lang.String date)
public static java.text.SimpleDateFormat getCanonicalFormat()
public static java.text.SimpleDateFormat getDateFormat()
public static java.lang.String getDateFormatString(java.text.SimpleDateFormat format)
format
- returns the pattern corresponding to the
date format
public static java.lang.String getCanonicalValue(java.util.Date date)
date
- a date object
public static java.util.Date getDate(java.lang.String date)
date
- string representation of a date
public static java.lang.String getDateValue(java.util.Date date)
public static void setDateFormat(java.text.SimpleDateFormat format)
format
- the new date format used for validationpublic static void setDefaultDateFormat()
public java.util.ArrayList validate(Project35FormContext project35FormContext, java.lang.String value)
validate
in interface EditFieldValidationService
validate
in class AbstractEditFieldValidationService
value
- the value of the field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |