Class AbstractXmlCalendarTypeHandler

    • Field Detail

      • dataTypeFactory

        protected static final javax.xml.datatype.DatatypeFactory dataTypeFactory
    • Constructor Detail

      • AbstractXmlCalendarTypeHandler

        public AbstractXmlCalendarTypeHandler()
    • Method Detail

      • format

        public abstract java.lang.String format​(java.lang.Object value)
        Description copied from interface: TypeHandler
        Formats a Java object into field text.
        Specified by:
        format in interface TypeHandler
        Overrides:
        format in class CalendarTypeHandler
        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 abstract javax.xml.namespace.QName getDatatypeQName()
        Returns the expected XML Schema data type when parse is called.
        Returns:
        the expected XML schema data type QName
      • newCalendar

        protected java.util.Calendar newCalendar()
        Creates a new calendar using the configured time zone (if set).
        Returns:
        a new Calendar instance
      • getTimeZoneOffset

        protected int getTimeZoneOffset​(java.util.Date date)
        Returns the time zone offset in minutes for the given date, or DatatypeConstants.FIELD_UNDEFINED if a time zone was not configured.
        Parameters:
        date - the date on which to determine the time zone offset
        Returns:
        the time zone offset in minutes, or DatatypeConstants.FIELD_UNDEFINED
      • isTimeZoneAllowed

        public boolean isTimeZoneAllowed()
        Returns whether time zone information is allowed when parsing field text. Defaults to true.
        Returns:
        true if time zone information is allowed when parsing field text
      • setTimeZoneAllowed

        public void setTimeZoneAllowed​(boolean timeZoneAllowed)
        Sets whether time zone information is allowed when parsing field text. Defaults to true.
        Parameters:
        timeZoneAllowed - true if time zone information is allowed when parsing field text
      • isLenientDatatype

        public boolean isLenientDatatype()
        Returns whether data type validation is skipped when parsing field text. Set to false by default, a TypeConversionException is thrown when a XML dateTime type handler is used to parse a XML date or XML time, or a XML date handler is used to parse a XML dateTime field, etc.
        Returns:
        true if data type validation is skipped
      • setLenientDatatype

        public void setLenientDatatype​(boolean lenientDatatype)
        Sets whether data type validation is skipped when parsing field text. Set to false by default, a TypeConversionException is thrown when a XML dateTime type handler is used to parse a XML date or XML time, or a XML date handler is used to parse a XML dateTime field, etc.
        Parameters:
        lenientDatatype - true if data type validation is skipped