public class StringToDate extends StringToObject
Date
types. Allows the configuration of an explicit date pattern and locale.SimpleDateFormat
Constructor and Description |
---|
StringToDate() |
Modifier and Type | Method and Description |
---|---|
Locale |
getLocale()
The locale to use in formatting date values.
|
String |
getPattern()
The pattern to use to format date values.
|
void |
setLocale(Locale locale)
Sets the locale to use in formatting date values.
|
void |
setPattern(String pattern)
Sets the pattern to use to format date values.
|
Object |
toObject(String string,
Class targetClass) |
String |
toString(Object target) |
convertSourceToTargetClass, convertTargetToSourceClass, getSourceClass, getTargetClass
public String getPattern()
public void setPattern(String pattern)
pattern
- the date formatting patternpublic Locale getLocale()
LocaleContextHolder.getLocale()
public void setLocale(Locale locale)
locale
- the localepublic Object toObject(String string, Class targetClass) throws Exception
Exception