DateDVpublic class DateDV extends DateTimeDV Validator for datatype (W3C Schema datatypes) |
Methods Summary |
---|
protected java.lang.String | dateToString(DateTimeData date)
StringBuffer message = new StringBuffer(25);
append(message, date.year, 4);
message.append('-");
append(message, date.month, 2);
message.append('-");
append(message, date.day, 2);
append(message, (char)date.utc, 0);
return message.toString();
| public java.lang.Object | getActualValue(java.lang.String content, org.apache.xerces.impl.dv.ValidationContext context)
try{
return parse(content);
} catch(Exception ex){
throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.1", new Object[]{content, "date"});
}
| protected javax.xml.datatype.XMLGregorianCalendar | getXMLGregorianCalendar(DateTimeData date)
return factory.newXMLGregorianCalendar(date.unNormYear, date.unNormMonth, date.unNormDay
, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, DatatypeConstants.FIELD_UNDEFINED, date.timezoneHr * 60 + date.timezoneMin);
| protected DateTimeData | parse(java.lang.String str)Parses, validates and computes normalized version of dateTime object
DateTimeData date = new DateTimeData(str, this);
int len = str.length();
int end = getDate(str, 0, len, date);
parseTimeZone (str, end, len, date);
//validate and normalize
//REVISIT: do we need SchemaDateTimeException?
validateDateTime(date);
//save unnormalized values
saveUnnormalized(date);
if (date.utc!=0 && date.utc!='Z") {
normalize(date);
}
return date;
|
|