Annotation Type CsvCustomBindByName


  • @Documented
    @Retention(RUNTIME)
    @Target(FIELD)
    public @interface CsvCustomBindByName
    Allows us to specify a class that will perform the translation from source to destination. For special needs, we can implement a class that takes the source field from the CSV and translates it into a form of our choice. The source column name may also be specified.
    Since:
    3.8
    Author:
    Andrew Rucker Jones
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<? extends AbstractBeanField> converter
      The class that takes care of the conversion.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String column
      If not specified, the name of the column must be identical to the name of the field.
      boolean required
      Whether or not the annotated field is required to be present in every data set of the input.
      • column

        java.lang.String column
        If not specified, the name of the column must be identical to the name of the field.
        Returns:
        The name of the column in the CSV file from which this field should be taken.
        Default:
        ""
      • required

        boolean required
        Whether or not the annotated field is required to be present in every data set of the input. This means that the input cannot be empty. The output after conversion is not guaranteed to be non-empty. "Input" means the string from the field in the CSV file on reading and the bean member variable on writing.
        Returns:
        If the field is required to contain information.
        Since:
        3.10
        Default:
        false