|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjoptsimple.util.DateConverter
public class DateConverter
Converts values to Dates using a DateFormat object.
| Constructor Summary | |
|---|---|
DateConverter(DateFormat formatter)
Creates a converter that uses the given date formatter/parser. |
|
| Method Summary | |
|---|---|
Date |
convert(String value)
Converts the given string value into a Java type. |
static DateConverter |
datePattern(String pattern)
Creates a converter that uses a SimpleDateFormat with the given date/time pattern. |
String |
valuePattern()
Gives a string that describes the pattern of the values this converter expects, if any. |
Class<Date> |
valueType()
Gives the class of the type of values this converter converts to. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateConverter(DateFormat formatter)
formatter - the formatter/parser to use
NullPointerException - if formatter is null| Method Detail |
|---|
public static DateConverter datePattern(String pattern)
SimpleDateFormat with the given date/time pattern. The date formatter
created is not lenient.
pattern - expected date/time pattern
NullPointerException - if pattern is null
IllegalArgumentException - if pattern is invalidpublic Date convert(String value)
ValueConverter
convert in interface ValueConverter<Date>value - the string to convert
public Class<Date> valueType()
ValueConverter
valueType in interface ValueConverter<Date>public String valuePattern()
ValueConverterdate format string.
valuePattern in interface ValueConverter<Date>null if there's nothing interesting here
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||