Annotation Type DataField


  • @Documented
    @Retention(RUNTIME)
    public @interface DataField
    An annotation used to identify in a POJO which property is link to a field of a record (csv, ...). The pos (mandatory) identifies the position of the data in the record The name is optional and could be used in the future to bind a property which a different name The columnName (optional) represents the name of the column who will appear in the header The pattern (optional) allows to define the pattern of the data (useful for Date, ...) The length (optional) allows to define for fixed length message the size of the data's block The precision(optional) reflects the precision to be used with BigDecimal number The position (optional) identify the position of the field in the CSV generated The required (optional) property identifies a field which is mandatory. The lengthPos (optional) identifies a field in this record that defines the fixed length for this field. The delimiter (optional) defines a character that is used to demarcate the field, if it has a variable length.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      int pos
      Position of the data in the input record, must start from 1 (mandatory).
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String align
      Align the text to the right or left.
      boolean clip
      Indicates to clip data in the field if it exceeds the allowed length when using fixed length.
      String columnName
      Name of the header column (optional).
      String decimalSeparator
      Decimal Separator to be used with BigDecimal number
      String defaultValue
      Field's default value in case no value is set
      String delimiter
      Optional delimiter to be used if the field has a variable length
      String groupingSeparator
      Grouping Separator to be used with BigDecimal number when we would like to format/parse to number with grouping e.g.
      boolean impliedDecimalSeparator
      Indicates if there is a decimal point implied at a specified location
      int length
      Length of the data block (number of characters) if the record is set to a fixed length
      int lengthPos
      Identifies a data field in the record that defines the expected fixed length for this field
      String method
      Method name to call to apply such customization on DataField.
      String name
      Name of the field (optional)
      char paddingChar
      The char to pad with if the record is set to a fixed length
      String pattern
      Pattern that the Java formatter (SimpleDateFormat by example) will use to transform the data (optional).
      int position
      Position of the field in the output message generated (should start from 1).
      int precision
      precision of the BigDecimal number to be created
      boolean required
      Indicates if the field is mandatory
      String rounding
      Round mode to be used to round/scale a BigDecimal Values : UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN,HALF_EVEN, UNNECESSARY e.g : Number = 123456.789, Precision = 2, Rounding = CEILING Result : 123456.79
      String timezone
      Timezone to be used.
      boolean trim
      Indicates if the value should be trimmed
    • Element Detail

      • pos

        int pos
        Position of the data in the input record, must start from 1 (mandatory). See the position parameter.
      • name

        String name
        Name of the field (optional)
        Default:
        ""
      • columnName

        String columnName
        Name of the header column (optional). Uses the name of the property as default. Only applicable when `CsvRecord` has `generateHeaderColumns = true`
        Default:
        ""
      • pattern

        String pattern
        Pattern that the Java formatter (SimpleDateFormat by example) will use to transform the data (optional). If using pattern, then setting locale on bindy data format is recommended. Either set to a known locale such as "us" or use "default" to use platform default locale.
        Default:
        ""
      • timezone

        String timezone
        Timezone to be used.
        Returns:
        String timezone ID
        Default:
        ""
      • length

        int length
        Length of the data block (number of characters) if the record is set to a fixed length
        Default:
        0
      • lengthPos

        int lengthPos
        Identifies a data field in the record that defines the expected fixed length for this field
        Default:
        0
      • align

        String align
        Align the text to the right or left. Use values R or L.
        Default:
        "R"
      • paddingChar

        char paddingChar
        The char to pad with if the record is set to a fixed length
        Default:
        ' '
      • precision

        int precision
        precision of the BigDecimal number to be created
        Default:
        0
      • position

        int position
        Position of the field in the output message generated (should start from 1). Must be used when the position of the field in the CSV generated (output message) must be different compare to input position (pos). See the pos parameter.
        See Also:
        pos()
        Default:
        0
      • required

        boolean required
        Indicates if the field is mandatory
        Default:
        false
      • trim

        boolean trim
        Indicates if the value should be trimmed
        Default:
        false
      • clip

        boolean clip
        Indicates to clip data in the field if it exceeds the allowed length when using fixed length.
        Default:
        false
      • delimiter

        String delimiter
        Optional delimiter to be used if the field has a variable length
        Default:
        ""
      • defaultValue

        String defaultValue
        Field's default value in case no value is set
        Default:
        ""
      • impliedDecimalSeparator

        boolean impliedDecimalSeparator
        Indicates if there is a decimal point implied at a specified location
        Default:
        false
      • decimalSeparator

        String decimalSeparator
        Decimal Separator to be used with BigDecimal number
        Default:
        ""
      • groupingSeparator

        String groupingSeparator
        Grouping Separator to be used with BigDecimal number when we would like to format/parse to number with grouping e.g. 123,456.789
        Default:
        ""
      • rounding

        String rounding
        Round mode to be used to round/scale a BigDecimal Values : UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN,HALF_EVEN, UNNECESSARY e.g : Number = 123456.789, Precision = 2, Rounding = CEILING Result : 123456.79
        Default:
        "CEILING"
      • method

        String method
        Method name to call to apply such customization on DataField. This must be the method on the datafield itself or you must provide static fully qualified name of the class's method e.g: see unit test org.apache.camel.dataformat.bindy.csv.BindySimpleCsvFunctionWithExternalMethodTest.replaceToBar
        Default:
        ""