Package org.beanio.types
Class DateTypeHandler
- java.lang.Object
- 
- org.beanio.types.LocaleSupport
- 
- org.beanio.types.DateTypeHandlerSupport
- 
- org.beanio.types.DateTypeHandler
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- ConfigurableTypeHandler,- TypeHandler
 - Direct Known Subclasses:
- AbstractXmlDateTypeHandler
 
 public class DateTypeHandler extends DateTypeHandlerSupport This type handler uses aSimpleDateFormatclass to parse and formatjava.util.Dateobjects. If no pattern is set,DateFormat.getInstance()is used to create a default date format. By default,lenientis false.- Since:
- 1.0
- See Also:
- Date,- DateFormat,- SimpleDateFormat
 
- 
- 
Field Summary- 
Fields inherited from class org.beanio.types.DateTypeHandlerSupportlenient, pattern, timeZone
 - 
Fields inherited from class org.beanio.types.LocaleSupportlocale
 - 
Fields inherited from interface org.beanio.types.ConfigurableTypeHandlerFORMAT_SETTING
 - 
Fields inherited from interface org.beanio.types.TypeHandlerNIL
 
- 
 - 
Constructor SummaryConstructors Constructor Description DateTypeHandler()Constructs a newDateTypeHandler.DateTypeHandler(java.lang.String pattern)Constructs a newDateTypeHandler.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringformat(java.lang.Object value)Formats a Java object into field text.java.lang.Class<?>getType()Returns the class type supported by this handler.java.util.Dateparse(java.lang.String text)Parses field text into a Java object.- 
Methods inherited from class org.beanio.types.DateTypeHandlerSupportcreateDateFormat, createDefaultDateFormat, formatDate, getPattern, getTimeZone, getTimeZoneId, isLenient, newInstance, parseDate, setLenient, setPattern, setTimeZoneId
 - 
Methods inherited from class org.beanio.types.LocaleSupportgetLocale, setLocale
 
- 
 
- 
- 
- 
Method Detail- 
parsepublic java.util.Date parse(java.lang.String text) throws TypeConversionExceptionDescription copied from interface:TypeHandlerParses field text into a Java object.- Parameters:
- text- the field text to parse, which may be null if the field was not passed in the record
- Returns:
- the parsed Java object
- Throws:
- TypeConversionException- if the text cannot be parsed
 
 - 
formatpublic java.lang.String format(java.lang.Object value) Description copied from interface:TypeHandlerFormats a Java object into field text.- Parameters:
- value- the Java object to format, which may be null
- Returns:
- the formatted field text, or nullto indicate the value is not present, orTypeHandler.NILfor XML formatted streams
 
 - 
getTypepublic java.lang.Class<?> getType() Description copied from interface:TypeHandlerReturns the class type supported by this handler. Primitive types should not be returned by this method- use the object equivalent instead.- Returns:
- the class type supported by this handler
 
 
- 
 
-