Annotation Type CsvRecord
-
@Documented @Retention(RUNTIME) public @interface CsvRecord
This annotation represents the root class of the model. When a CSV, fixed-length record must be described in the model we will use this annotation and the separator (for csv record) to know how to split the data during the unmarshal process The separator (mandatory) The name is optional and could be used in the future to bind a property which a different name The skipfirstline (optional) allows to skip the first line of the file/content received The generateHeaderColumnNames (optional) allow to add in the CSV generated the header containing names of the columns The crlf (optional) is used to add a new line after a record. By default, the value is WINDOWS The isOrdered (optional) boolean is used to ordered the message generated in output
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
allowEmptyStream
The allowEmptyStream parameter will allow to prcoess the unavaiable stream for CSV file.boolean
autospanLine
Last record spans rest of line (optional) - if enabled then the last column is auto spanned to end of line, for example if its a comment, etc this allows the line to contain all characters, also the delimiter char.String
crlf
Character to be used to add a carriage return after each record (optional) - allow to define the carriage return character to use.boolean
endWithLineBreak
The endWithLineBreak parameter flags if the CSV file should end with a line break or not (optional)boolean
generateHeaderColumns
The generateHeaderColumns parameter allow to add in the CSV generated the header containing names of the columnsboolean
isOrdered
Indicates if the message must be ordered in outputString
name
Name describing the record (optional)String
quote
Whether to marshal columns with the given quote character (optional) - allow to specify a quote character of the fields when CSV is generated.boolean
quoting
Indicate if the values (and headers) must be quoted when marshaling (optional)boolean
quotingEscaped
Indicate if the values must be escaped when quoting (optional)boolean
quotingOnlyWhenNeeded
Indicate if the values should be quoted only when needed (optional) - if enabled then the value is only quoted when it contains the configured separator, quote, or crlf characters.boolean
removeQuotes
The remove quotes parameter flags if unmarshalling should try to remove quotes for each fieldboolean
skipField
The skipField parameter will allow to skip fields of a CSV file.boolean
skipFirstLine
The skipFirstLine parameter will allow to skip or not the first line of a CSV file.boolean
trimLine
Whether to trim each line (stand and end) before parsing the line into data fields.
-
-
-
Element Detail
-
separator
String separator
Separator used to split a record in tokens (mandatory) - can be ',' or ';' or 'anything'. The only whitespace character supported is tab (\t). No other whitespace characters (spaces) are not supported. This value is interpreted as a regular expression. If you want to use a sign which has a special meaning in regular expressions, e.g. the '\|' sign, then you have to mask it, like '\|'
-
-
-
name
String name
Name describing the record (optional)- Default:
- ""
-
-
-
crlf
String crlf
Character to be used to add a carriage return after each record (optional) - allow to define the carriage return character to use. If you specify a value other than the three listed before, the value you enter (custom) will be used as the CRLF character(s). Three values can be used : WINDOWS, UNIX, MAC, or custom.- Default:
- "WINDOWS"
-
-
-
quote
String quote
Whether to marshal columns with the given quote character (optional) - allow to specify a quote character of the fields when CSV is generated. This annotation is associated to the root class of the model and must be declared one time.- Default:
- "\""
-
-