}
// use nested class to efficiently get a hold of the underlying Date object (w/o doing reparsing, etc...)
private static abstract class DateWritableWriter {
static String toES(Object dateWritable) {
DateWritable dw = (DateWritable) dateWritable;
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(dw.get().getTime());
return DatatypeConverter.printDate(cal);
}