BeanIO 1.2.3

org.beanio.types.xml
Class XmlDateTimeTypeHandler

java.lang.Object
  extended by org.beanio.types.DateTypeHandler
      extended by org.beanio.types.xml.AbstractXmlDateTypeHandler
          extended by org.beanio.types.xml.XmlDateTimeTypeHandler
All Implemented Interfaces:
ConfigurableTypeHandler, TypeHandler

public class XmlDateTimeTypeHandler
extends AbstractXmlDateTypeHandler

A java.util.Date type handler implementation for parsing date-time values based on the W3C XML Schema dateTime datatype specification.

Since:
1.1
Author:
Kevin Seim

Field Summary
 
Fields inherited from class org.beanio.types.xml.AbstractXmlDateTypeHandler
dataTypeFactory
 
Fields inherited from interface org.beanio.types.ConfigurableTypeHandler
FORMAT_SETTING
 
Fields inherited from interface org.beanio.types.TypeHandler
NIL
 
Constructor Summary
XmlDateTimeTypeHandler()
           
 
Method Summary
 String format(Object value)
          Formats a Java object into field text.
protected  QName getDatatypeQName()
          Returns the expected XML Schema data type when parse is called.
 boolean isOutputMilliseconds()
          Returns whether milliseconds are included when formatting the time.
 void setOutputMilliseconds(boolean b)
          Sets whether milliseconds are included when formatting the time.
 
Methods inherited from class org.beanio.types.xml.AbstractXmlDateTypeHandler
getTimeZoneId, getTimeZoneOffset, isLenientDatatype, isTimeZoneAllowed, newCalendar, parse, setLenientDatatype, setTimeZoneAllowed, setTimeZoneId
 
Methods inherited from class org.beanio.types.DateTypeHandler
createDateFormat, createDefaultDateFormat, getPattern, getType, isLenient, newInstance, setLenient, setPattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDateTimeTypeHandler

public XmlDateTimeTypeHandler()
Method Detail

format

public String format(Object value)
Description copied from interface: TypeHandler
Formats a Java object into field text.

Specified by:
format in interface TypeHandler
Specified by:
format in class AbstractXmlDateTypeHandler
Parameters:
value - the Java object to format, which may be null
Returns:
the formatted field text, or null to indicate the value is not present, or TypeHandler.NIL for XML formatted streams

getDatatypeQName

protected QName getDatatypeQName()
Description copied from class: AbstractXmlDateTypeHandler
Returns the expected XML Schema data type when parse is called.

Specified by:
getDatatypeQName in class AbstractXmlDateTypeHandler
Returns:
the expected XML schema data type QName

isOutputMilliseconds

public boolean isOutputMilliseconds()
Returns whether milliseconds are included when formatting the time.

Returns:
true if milliseconds are included when formatting the time

setOutputMilliseconds

public void setOutputMilliseconds(boolean b)
Sets whether milliseconds are included when formatting the time. Set to false by default.

Parameters:
b - set to true to include milliseconds when formatting the time

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim