if (clazz == DateLabel.class) {
DateTimeFormat format = (DateTimeFormat) attributes.get("format");
if (format != null) {
return new DateLabel(format);
}
String predefinedFormat = (String) attributes.get("predefinedFormat");
if (predefinedFormat != null) {
PredefinedFormat predef = PredefinedFormat.valueOf(predefinedFormat);
return new DateLabel(DateTimeFormat.getFormat(predef));
}
String customFormat = (String) attributes.get("customFormat");
if (customFormat != null) {
return new DateLabel(DateTimeFormat.getFormat(customFormat));
}
}
// unable to use custom constructor or is a subclass of DateLabel, so