Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Converters should benefit from Generics

...

Sticking to simplicity in conversion and validation would create solutions with much more shelf-life and generality than we can get from existing solutions or even JSR-303.

– Jonathan

Converters should benefit from Genericsh5. Converters should benefit from Generics

It's unbelievable that during the age of generics, one must cast the result of a conversion:

Code Block

  /**
   * @param <DataType> 
   * @param formComponent
   * @return DataType
   */
  public static <DataType> DataType getFreshValue(FormComponent<DataType> formComponent) {
    return (DataType) formComponent.getConverter(formComponent.getType()).convertToObject(formComponent.getValue(), formComponent.getLocale()); 
  }

It's unbelievable that during the age of generics, one must cast the result of a conversion:

...