Annotation 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 ElementsModifier and TypeRequired ElementDescriptionint
Position of the data in the input record, must start from 1 (mandatory). -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAlign the text to the right or left.boolean
Indicates to clip data in the field if it exceeds the allowed length when using fixed length.Name of the header column (optional).Decimal Separator to be used with BigDecimal numberField's default value in case no value is setOptional delimiter to be used if the field has a variable lengthGrouping Separator to be used with BigDecimal number when we would like to format/parse to number with grouping e.g.boolean
Indicates if there is a decimal point implied at a specified locationint
Length of the data block (number of characters) if the record is set to a fixed lengthint
Identifies a data field in the record that defines the expected fixed length for this fieldMethod name to call to apply such customization on DataField.Name of the field (optional)char
The char to pad with if the record is set to a fixed lengthPattern that the Java formatter (SimpleDateFormat by example) will use to transform the data (optional).int
Position of the field in the output message generated (should start from 1).int
precision of theBigDecimal
number to be createdboolean
Indicates if the field is mandatoryRound 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.79Timezone to be used.boolean
Indicates if the value should be trimmed
-
Element Details
-
pos
int posPosition of the data in the input record, must start from 1 (mandatory). See the position parameter.
-
-
-
name
String nameName of the field (optional)- Default:
- ""
-
columnName
String columnNameName of the header column (optional). Uses the name of the property as default. Only applicable when `CsvRecord` has `generateHeaderColumns = true`- Default:
- ""
-
pattern
String patternPattern 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 timezoneTimezone to be used.- Returns:
- String timezone ID
- Default:
- ""
-
length
int lengthLength of the data block (number of characters) if the record is set to a fixed length- Default:
- 0
-
lengthPos
int lengthPosIdentifies a data field in the record that defines the expected fixed length for this field- Default:
- 0
-
align
String alignAlign the text to the right or left. Use values R or L.- Default:
- "R"
-
paddingChar
char paddingCharThe char to pad with if the record is set to a fixed length- Default:
- ' '
-
precision
int precisionprecision of theBigDecimal
number to be created- Default:
- 0
-
position
int positionPosition 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:
- Default:
- 0
-
required
boolean requiredIndicates if the field is mandatory- Default:
- false
-
trim
boolean trimIndicates if the value should be trimmed- Default:
- false
-
clip
boolean clipIndicates to clip data in the field if it exceeds the allowed length when using fixed length.- Default:
- false
-
delimiter
String delimiterOptional delimiter to be used if the field has a variable length- Default:
- ""
-
defaultValue
String defaultValueField's default value in case no value is set- Default:
- ""
-
impliedDecimalSeparator
boolean impliedDecimalSeparatorIndicates if there is a decimal point implied at a specified location- Default:
- false
-
decimalSeparator
String decimalSeparatorDecimal Separator to be used with BigDecimal number- Default:
- ""
-
groupingSeparator
String groupingSeparatorGrouping 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 roundingRound 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 methodMethod 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:
- ""
-