Fork me on GitHub
Edit on GitHub << back to Annotations

Conversion Annotation

A marker annotation for type conversions at Type level.

Usage

The Conversion annotation must be applied at Type level.

Parameters

Parameter Required Default Description
conversions no   used for Type Conversions applied at Type level.

Examples

 @Conversion(
     conversions = {
          // key must be the name of a property for which converter should be used
          @TypeConversion(key = "date", converter = "org.demo.converter.DateConverter")
     }
 )
 public class ConversionAction implements Action {

     private Date date;

     public setDate(Date date) {
         this.date = date;
     }

     public Date getDate() {
         return date;
     }

 }

Check also TypeConversion Annotation for more examples!