org.mentawai.converter
Class DateConverter
java.lang.Object
org.mentawai.converter.LocaleConverter
org.mentawai.converter.DateConverter
- All Implemented Interfaces:
- Converter
public class DateConverter
- extends LocaleConverter
Converts a java.lang.String to a java.util.Date using the user locale.
- Author:
- Sergio Oliveira
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DateConverter
public DateConverter()
- Creates an converter using the default DateFormat style (SHORT).
DateConverter
public DateConverter(int style)
- Creates an converter using the given DateFormat style.
- Parameters:
style - The DateFormat style. (Ex: DateFormat.SHORT, DateFormat.FULL, etc.)
DateConverter
public DateConverter(SimpleDateFormat sdf)
DateConverter
public DateConverter(String pattern)
convert
public Object convert(Object value,
Locale loc)
throws ConversionException
- Description copied from class:
LocaleConverter
- Convert an object to another one using the use locale.
- Specified by:
convert in class LocaleConverter
- Parameters:
value - The object to convert.loc - The user locale to use in the convertion.
- Returns:
- The new object converted.
- Throws:
ConversionException - if the conversion fail for any reason.
Copyright © 2012. All Rights Reserved.