// Javadoc inherited
protected void initialiseElementSpecificAttributes(
XDIMEContextInternal context, XDIMEAttributes attributes)
throws XDIMEException {
ResponseDatePickerAttributes responseDatePickerAttributes = (ResponseDatePickerAttributes) protocolAttributes;
String currentDate = attributes.getValue("", "current-date");
String rangeStart = attributes.getValue("", "range-start");
String rangeEnd = attributes.getValue("", "range-end");
SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
if(currentDate != null) {
date = dateFormater.parse(currentDate);
responseDatePickerAttributes.setCurrentDate(dateFormater.format(date));
}
} catch (ParseException e) {
throw new XDIMEException("Invalid date format for current-date attribute.");
}
try {
if(rangeStart != null) {
date = dateFormater.parse(rangeStart);
responseDatePickerAttributes.setRangeStart(dateFormater.format(date));
}
} catch (ParseException e) {
throw new XDIMEException("Invalid date format for range-start attribute.");
}
try {
if(rangeEnd != null) {
date = dateFormater.parse(rangeEnd);
responseDatePickerAttributes.setRangeEnd(dateFormater.format(date));
}
} catch (ParseException e) {
throw new XDIMEException("Invalid date format for range-end attribute.");
}