assert date != null;
/*
* Step 5.4.1: check is custom date format annotation added.
*/
DateFormat currentFormat = (customInfo != null && customInfo.format().length() > 0) ?
DateFormat.CUSTOM : this.dateFormat;
/*
* Step 5.4.2: serialize date based on format.
*/
switch(currentFormat){
case PLAIN:
this.add(String.valueOf(date.getTime()));
break;
case CUSTOM:
this.string(this.date2String(date,customInfo.format()));
return;
default:
this.string(this.date2String(date,currentFormat.getFormat()));
}
}