Class YearNameConverter

  • All Implemented Interfaces:
    ObjectConverter

    public class YearNameConverter
    extends NumberConverter
    Converter which converts year to int and converts it back. It is no difference from a number converter except it doesn't use grouping when formatting.
    • Field Detail

      • CONTEXT

        public static ConverterContext CONTEXT
        Default ConverterContext for MonthConverter.
    • Constructor Detail

      • YearNameConverter

        public YearNameConverter()
        Creates a new CalendarConverter.
    • Method Detail

      • getDefaultNumberFormat

        protected java.text.NumberFormat getDefaultNumberFormat()
        Description copied from class: NumberConverter
        Gets the NumberFormat for Locale.US.
        Overrides:
        getDefaultNumberFormat in class NumberConverter
        Returns:
        the NumberFormat for Locale.US.
      • fromString

        public java.lang.Object fromString​(java.lang.String string,
                                           ConverterContext context)
        Description copied from interface: ObjectConverter
        Converts from String to an object.
        Parameters:
        string - the string
        context - context to be converted
        Returns:
        the object converted from string
      • supportFromString

        public boolean supportFromString​(java.lang.String string,
                                         ConverterContext context)
        Description copied from interface: ObjectConverter
        If it supports fromString.
        Parameters:
        string - the string
        context - context to be converted
        Returns:
        true if it supports