DateTimeDVpublic class DateTimeDV extends AbstractDateTimeDV Validator for datatype (W3C Schema Datatypes) |
Methods Summary |
---|
public java.lang.Object | getActualValue(java.lang.String content, com.sun.org.apache.xerces.internal.impl.dv.ValidationContext context)
try{
return new DateTimeData(parse(content), this);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "dateTime"});
}
| protected int[] | parse(java.lang.String str)Parses, validates and computes normalized version of dateTime object
int len = str.length();
int[] date = new int[TOTAL_SIZE];
int[] timeZone = new int[2];
int end = indexOf (str, 0, len, 'T");
// both time and date
getDate(str, 0, end, date);
getTime(str, end+1, len, date, timeZone);
//validate and normalize
//REVISIT: do we need SchemaDateTimeException?
validateDateTime(date, timeZone);
if ( date[utc]!=0 && date[utc]!='Z") {
normalize(date, timeZone);
}
return date;
|
|