Annotation Type Convert


Tells Rewrite to use a converter to convert the value of a specific parameter binding.

There are various ways to specify the kind of converter you want to use. You could for example reference a converter class this way:
 @ParameterBinding
 @Convert(with = MyLocaleConverter.class)
 private Locale locale;
 

You can always refer to Converter implementations this way. Integration modules like the JSF integration module provide support for frameworks specific converters on top of that.

You can also refer to a converter using an unique ID like this:

 @ParameterBinding
 @Convert(id = "com.example.MyConverterId")
 private Locale locale;
 

Without any attributes set, Rewrite will try to find a converter by the type of the annotated field.

 @ParameterBinding
 @Convert
 private Locale locale;
 

Please note that which of the three ways works in your case highly depends on the integration modules that you have added to your application.

Author:
Christian Kaltepoth
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Can be used to refer to a converter by some kind of unique ID.
    Can be used to refer to a converter class that should be used for conversion.
  • Element Details

    • with

      Class<?> with
      Can be used to refer to a converter class that should be used for conversion.
      Default:
      java.lang.Object.class
    • id

      String id
      Can be used to refer to a converter by some kind of unique ID.
      Default:
      ""