Package org.beanio.types.xml
Class XmlTimeTypeHandler
- java.lang.Object
-
- org.beanio.types.LocaleSupport
-
- org.beanio.types.DateTypeHandlerSupport
-
- org.beanio.types.DateTypeHandler
-
- org.beanio.types.xml.AbstractXmlDateTypeHandler
-
- org.beanio.types.xml.XmlTimeTypeHandler
-
- All Implemented Interfaces:
java.lang.Cloneable
,ConfigurableTypeHandler
,TypeHandler
public class XmlTimeTypeHandler extends AbstractXmlDateTypeHandler
Ajava.util.Date
type handler implementation for parsing times based on the W3C XML Schema time datatype specification.- Since:
- 1.1
-
-
Field Summary
-
Fields inherited from class org.beanio.types.xml.AbstractXmlDateTypeHandler
dataTypeFactory
-
Fields inherited from class org.beanio.types.DateTypeHandlerSupport
lenient, pattern, timeZone
-
Fields inherited from class org.beanio.types.LocaleSupport
locale
-
Fields inherited from interface org.beanio.types.ConfigurableTypeHandler
FORMAT_SETTING
-
Fields inherited from interface org.beanio.types.TypeHandler
NIL
-
-
Constructor Summary
Constructors Constructor Description XmlTimeTypeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(java.lang.Object value)
Formats a Java object into field text.protected javax.xml.namespace.QName
getDatatypeQName()
Returns the expected XML Schema data type whenparse
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
getTimeZoneOffset, isLenientDatatype, isTimeZoneAllowed, newCalendar, parse, setLenientDatatype, setTimeZoneAllowed
-
Methods inherited from class org.beanio.types.DateTypeHandler
getType
-
Methods inherited from class org.beanio.types.DateTypeHandlerSupport
createDateFormat, createDefaultDateFormat, formatDate, getPattern, getTimeZone, getTimeZoneId, isLenient, newInstance, parseDate, setLenient, setPattern, setTimeZoneId
-
Methods inherited from class org.beanio.types.LocaleSupport
getLocale, setLocale
-
-
-
-
Method Detail
-
format
public java.lang.String format(java.lang.Object value)
Description copied from interface:TypeHandler
Formats a Java object into field text.- Specified by:
format
in interfaceTypeHandler
- Specified by:
format
in classAbstractXmlDateTypeHandler
- 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, orTypeHandler.NIL
for XML formatted streams
-
getDatatypeQName
protected javax.xml.namespace.QName getDatatypeQName()
Description copied from class:AbstractXmlDateTypeHandler
Returns the expected XML Schema data type whenparse
is called.- Specified by:
getDatatypeQName
in classAbstractXmlDateTypeHandler
- 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 tofalse
by default.- Parameters:
b
- set totrue
to include milliseconds when formatting the time
-
-