By extending the StringAdapter and overriding its normal behavior we can create a custom Date formatter:19 1 0 7 8 4 300 105
public static class CustomDateAdapter extends StringAdapter { protected String getStringValue() { Date date = (Date)getPropertyValue(); return DateFormat.getTimeInstance( DateFormat.FULL ).format( date ); } }Producing output like:
The StringAdapter (which is normally invoked only to adapt String values) is a useful base for these kinds of customizations and can produce structured XML output as well as plain text by setting its parseStringAsXML() property to true. See provided examples.12:02:54 AM CDT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|