Package org.beanio.types.xml
Class XmlCalendarTimeTypeHandler
- java.lang.Object
-
- org.beanio.types.LocaleSupport
-
- org.beanio.types.DateTypeHandlerSupport
-
- org.beanio.types.CalendarTypeHandler
-
- org.beanio.types.xml.AbstractXmlCalendarTypeHandler
-
- org.beanio.types.xml.XmlCalendarTimeTypeHandler
-
- All Implemented Interfaces:
java.lang.Cloneable
,ConfigurableTypeHandler
,TypeHandler
public class XmlCalendarTimeTypeHandler extends AbstractXmlCalendarTypeHandler
ACalendar
type handler implementation for parsing dates based on the W3C XML Schema time datatype specification.- Since:
- 2.1.0
-
-
Field Summary
-
Fields inherited from class org.beanio.types.xml.AbstractXmlCalendarTypeHandler
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 XmlCalendarTimeTypeHandler()
-
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.AbstractXmlCalendarTypeHandler
getTimeZoneOffset, isLenientDatatype, isTimeZoneAllowed, newCalendar, parse, setLenientDatatype, setTimeZoneAllowed
-
Methods inherited from class org.beanio.types.CalendarTypeHandler
formatCalendar, 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 classAbstractXmlCalendarTypeHandler
- 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:AbstractXmlCalendarTypeHandler
Returns the expected XML Schema data type whenparse
is called.- Specified by:
getDatatypeQName
in classAbstractXmlCalendarTypeHandler
- 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
-
-