org.beanio.types.xml
Class XmlDateTimeTypeHandler
java.lang.Object
org.beanio.types.DateTypeHandler
org.beanio.types.xml.AbstractXmlDateTypeHandler
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XmlDateTimeTypeHandler
public XmlDateTimeTypeHandler()
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
Copyright © 2010-2012 Kevin Seim