|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.fdsapi.ConverterBase
|
+--com.fdsapi.ConverterDateToString
This class takes a Date Object and formats it into a String with a DateFormat object.
Note due to its use of the nonthread safe class NumberFormat this class is NOT thread safe. It could be wrapped in a ThreadSafe object if this is important. However when used with the ArrayConverter a new Converter will always be created at the appropriate time and so the developer need not worry about it. If a converter is used as say an instance variable in another class then you would need to ensure that a createInstance() is first called in a multithreaded environment.
Sample call:
Converter converter=new ConverterNumToString();// default DateFormat including short date and time
converter=new ConverterNumToString(DateFormat.getInstance());// same as default
converter=new ConverterNumToString(DateFormat.getDateInstance());
converter=new ConverterNumToString(DateFormat.getDateTimeInstance());
...
| Constructor Summary | |
ConverterDateToString()
Creates a new instance of ConverterNumToString |
|
ConverterDateToString(Converter nextConverter)
Constructor that takes the next converter in the decorator chain |
|
ConverterDateToString(java.text.DateFormat dateFormat)
Constructor that takes the formatter that will be used to format the date |
|
ConverterDateToString(java.text.DateFormat dateFormat,
Converter nextConverter)
Constructor that takes the DateFormat object that will be used as well as the next Converter that will be called in the decorator chain. |
|
| Method Summary | |
java.lang.Object |
convert(java.lang.Object inputObj)
|
protected Converter |
createInstance(Converter nextConverter)
Creates a cloned/copy of this Object. |
| Methods inherited from class com.fdsapi.ConverterBase |
createInstance, decoratorConvert |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConverterDateToString()
public ConverterDateToString(java.text.DateFormat dateFormat)
public ConverterDateToString(Converter nextConverter)
public ConverterDateToString(java.text.DateFormat dateFormat,
Converter nextConverter)
| Method Detail |
public java.lang.Object convert(java.lang.Object inputObj)
protected Converter createInstance(Converter nextConverter)
createInstance in class ConverterBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||