Character antC = null;
for (Character c : format.toCharArray()) {
try {
DateWord dateWord = DateWord.get(c);
if (!c.equals(antC)) {
String cssClass = "date_" + dateWord.getDescription();
if (params.get("cssClass") != null) {
cssClass += " " + params.get("cssClass");
}
attr = new Attributes();
attr.add("type", "text")
.addIfExists("class", cssClass)
.addIfExists("size", dateWord.getLength())
.addIfExists("maxlength", dateWord.getLength())
.addIfTrue("disabled", params.get("disabled"))
.addIfTrue("readonly", params.get("readonly"))
.addIfExists("tabindex", params.get("tabindex"))
.addIfExists("style", params.get("cssStyle"))
.addIfExists("title", params.get("title"));
if (id != null && !"".equals(id)) {
attr.addDefaultToEmpty("id", "__" + dateWord.getDescription() + "_" + id);
}
if (name != null && !"".equals(id)) {
attr.addDefaultToEmpty("name", "__" + dateWord.getDescription() + "_" + name);
} else {
attr.addDefaultToEmpty("name", dateWord.getDescription());
}
if (date != null) {
SimpleDateFormat formatter = new SimpleDateFormat(dateWord.getDateType());
attr.addIfExists("value", formatter.format(date), false);
}
super.start("input", attr);
super.end("input");