Keith Donald opened SPR-6013 and commented
As a developer, I would like to be able to conveniently associated a Formatter implementation with a particular object class by simply annotating that class.
Proposal: @Formatted
/**
* A type that can be formatted as a String for display in a UI.
* @author Keith Donald
* @since 3.0
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Formatted {
/**
* The Formatter that handles the formatting.
*/
Class<?> value();
}
@Formatted(AddressFormatter.class)
public static class Address {
private String street;
private String city;
private String state;
private String zip;
private String country;
}
Referenced from: commits 20f5f99, 2381452