Class TemporalAccessorTypeHandler

    • 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.
      java.lang.Class<?> getType()
      Returns the class type supported by this handler.
      TypeHandler newInstance​(java.util.Properties properties)
      Creates a customized instance of this type handler.
      java.time.temporal.TemporalAccessor parse​(java.lang.String text)
      Parses field text into a Java object.
      void setTypeName​(java.lang.String typeName)
      Used in custom type handlers defined in XML configurations to specify the actual subclass of TemporalAccessor to handle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TemporalAccessorTypeHandler

        public TemporalAccessorTypeHandler()
      • TemporalAccessorTypeHandler

        public TemporalAccessorTypeHandler​(java.lang.Class<?> type,
                                           java.time.format.DateTimeFormatter formatter)
    • Method Detail

      • newInstance

        public TypeHandler newInstance​(java.util.Properties properties)
        Description copied from interface: ConfigurableTypeHandler
        Creates a customized instance of this type handler.
        Specified by:
        newInstance in interface ConfigurableTypeHandler
        Parameters:
        properties - the properties for customizing the instance
        Returns:
        the new TypeHandler
      • parse

        public java.time.temporal.TemporalAccessor parse​(java.lang.String text)
                                                  throws TypeConversionException
        Description copied from interface: TypeHandler
        Parses field text into a Java object.
        Specified by:
        parse in interface TypeHandler
        Parameters:
        text - the field text to parse, which may be null if the field was not passed in the record
        Returns:
        the parsed Java object
        Throws:
        TypeConversionException - if the text cannot be parsed
      • 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 interface TypeHandler
        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
      • setTypeName

        public void setTypeName​(java.lang.String typeName)
                         throws java.lang.ClassNotFoundException
        Used in custom type handlers defined in XML configurations to specify the actual subclass of TemporalAccessor to handle.
        Throws:
        java.lang.ClassNotFoundException
      • getType

        public java.lang.Class<?> getType()
        Description copied from interface: TypeHandler
        Returns the class type supported by this handler. Primitive types should not be returned by this method- use the object equivalent instead.
        Specified by:
        getType in interface TypeHandler
        Returns:
        the class type supported by this handler