|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dhmp.util.xml.validator.Validator org.dhmp.util.xml.validator.DateTimeValidator
Validates date, time and dateTime data type. The conversion is locale sensitive and depends on time zone. The date separator and the time zone depend on current SchemaCollection's locale and date time settings.
Nested Class Summary |
Nested classes inherited from class org.dhmp.util.xml.validator.Validator |
Validator.ValidationFailed |
Field Summary | |
static int |
DATE
Represents date data type. |
static int |
DATE_TIME
Represents dateTime data type. |
static int |
NOT_DATE
Represents not a date data type. |
static int |
TIME
Represents time data type. |
Fields inherited from class org.dhmp.util.xml.validator.Validator |
FAIL |
Constructor Summary | |
DateTimeValidator(java.util.Locale locale,
java.util.TimeZone timeZone,
int type)
Creates a new instance of DateTimeValidator. |
Method Summary | |
int |
compareTo(java.lang.Object o1,
java.lang.Object o2)
Abstract method for comparing two valid objects used for boundry check. |
java.lang.Object |
newValue(java.lang.Object value)
Creates a java instance of corresponding object depending on data type this Validator is written for. |
static java.util.Date |
parse(java.lang.String stringValue,
java.util.TimeZone defaultTimeZone,
int type)
|
java.lang.Object |
validate(java.lang.String name,
java.lang.Object value,
HierarchicalMap constraints,
Schema schema,
HierarchicalMap messages,
int replace)
Returns true if the validation is successfull. |
Methods inherited from class org.dhmp.util.xml.validator.Validator |
appendMessage, checkBoundary, checkEnumeration, checkNillable, checkPattern, convert, hasFailed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOT_DATE
public static final int DATE
public static final int TIME
public static final int DATE_TIME
Constructor Detail |
public DateTimeValidator(java.util.Locale locale, java.util.TimeZone timeZone, int type)
locale
- SchemaCollection's locale.timeZone
- SchemaCollection's timeZone.type
- date, time or dateTime data type which this validator will represent.Method Detail |
public java.lang.Object validate(java.lang.String name, java.lang.Object value, HierarchicalMap constraints, Schema schema, HierarchicalMap messages, int replace)
Validator
validate
in class Validator
name
- name of schema component beeing validated.value
- value that is beeing validated.constraints
- HierarchicalMap containing constraints.schema
- reference to Schema which is validating the current value.messages
- StringBuffer where the error messages are appended.replace
- true if value should be replaced by corresponding java Object.
public static java.util.Date parse(java.lang.String stringValue, java.util.TimeZone defaultTimeZone, int type)
public int compareTo(java.lang.Object o1, java.lang.Object o2)
Validator
compareTo
in class Validator
o1
- first object.o2
- second object.
public java.lang.Object newValue(java.lang.Object value)
Validator
newValue
in class Validator
value
- value to be converted to java object depending on data type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |