Class AbstractConverter<C>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String convertToString​(C value, java.util.Locale locale)
      Converts the given value to a string.
      protected abstract java.lang.Class<C> getTargetType()  
      protected ConversionException newConversionException​(java.lang.String message, java.lang.Object value, java.util.Locale locale)
      Creates a conversion exception for throwing
      protected C parse​(java.text.Format format, java.lang.Object value, java.util.Locale locale)
      Parses a value using one of the java.util.text format classes.
      • Methods inherited from class java.lang.Object

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

      • AbstractConverter

        public AbstractConverter()
    • Method Detail

      • parse

        protected C parse​(java.text.Format format,
                          java.lang.Object value,
                          java.util.Locale locale)
        Parses a value using one of the java.util.text format classes.
        Parameters:
        format - The format to use
        value - The object to parse
        locale - The locale to use to parse.
        Returns:
        The object
        Throws:
        ConversionException - Thrown if parsing fails
      • newConversionException

        protected ConversionException newConversionException​(java.lang.String message,
                                                             java.lang.Object value,
                                                             java.util.Locale locale)
        Creates a conversion exception for throwing
        Parameters:
        message - The message
        value - The value that didn't convert
        locale - The locale
        Returns:
        The ConversionException
      • getTargetType

        protected abstract java.lang.Class<C> getTargetType()
        Returns:
        The target type of this type converter