java.lang.Object
org.scopemvc.util.convertor.NullStringConvertor
org.scopemvc.util.convertor.DateStringConvertor
org.scopemvc.util.convertor.TimeStringConvertor
- All Implemented Interfaces:
- StringConvertor
- public class TimeStringConvertor
- extends DateStringConvertor
String convertor for type org.scopemvc.util.Time or
java.util.Date. Date
part of Date instances are ignored.
It uses one java.text.DateFormat DateFormat for converting
into String and an array of DateFormats for
parsing. Parsing formats are successively used to try to parse until
one is successful.
Formats are picked up from config (see
org.scopemvc.util.DefaultScopeConfig for details)
or if none in config, the default formatter is:
DateFormat.getTimeInstance(DateFormat.MEDIUM)
and default parsers are:
DateFormat.getTimeInstance(DateFormat.FULL);
DateFormat.getTimeInstance(DateFormat.LONG);
DateFormat.getTimeInstance(DateFormat.MEDIUM);
DateFormat.getTimeInstance(DateFormat.SHORT);
Note: the default parsing set is initialized during class loading
and based on default platform locale. If application uses other locales,
there will be need to set parsing objects explicitly.
- Version:
- $Revision: 1.4 $ $Date: 2002/01/12 09:35:41 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
defaultParsers
private static final java.text.DateFormat[] defaultParsers
TimeStringConvertor
public TimeStringConvertor()
- Creates new TimeStringConvertor. If formats and parsers
are specified in config then use those else use current locale default
format and platform locale default parsers.
TimeStringConvertor
public TimeStringConvertor(java.text.DateFormat inFormatter,
java.text.DateFormat[] inParsers)
- Creates new TimeStringConvertor with specified formatter and parsers.
getDefaultParsers
protected java.text.DateFormat[] getDefaultParsers()
- Overrides:
getDefaultParsers in class DateStringConvertor