Annotation 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
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
The allowEmptyStream parameter will allow to prcoess the unavaiable stream for CSV file.boolean
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.Character to be used to add a carriage return after each record (optional) - allow to define the carriage return character to use.boolean
The endWithLineBreak parameter flags if the CSV file should end with a line break or not (optional)boolean
The generateHeaderColumns parameter allow to add in the CSV generated the header containing names of the columnsboolean
Indicates if the message must be ordered in outputName describing the record (optional)Whether to marshal columns with the given quote character (optional) - allow to specify a quote character of the fields when CSV is generated.boolean
Indicate if the values (and headers) must be quoted when marshaling (optional)boolean
Indicate if the values must be escaped when quoting (optional)boolean
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
The remove quotes parameter flags if unmarshalling should try to remove quotes for each fieldboolean
The skipField parameter will allow to skip fields of a CSV file.boolean
The skipFirstLine parameter will allow to skip or not the first line of a CSV file.boolean
Whether to trim each line (stand and end) before parsing the line into data fields.
-
Element Details
-
separator
String separatorSeparator 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 nameName describing the record (optional)- Default:
- ""
-
skipFirstLine
boolean skipFirstLineThe skipFirstLine parameter will allow to skip or not the first line of a CSV file. This line often contains columns definition- Default:
- false
-
skipField
boolean skipFieldThe skipField parameter will allow to skip fields of a CSV file. If some fields are not necessary, they can be skipped.- Default:
- false
-
crlf
String crlfCharacter 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"
-
generateHeaderColumns
boolean generateHeaderColumnsThe generateHeaderColumns parameter allow to add in the CSV generated the header containing names of the columns- Default:
- false
-
isOrdered
boolean isOrderedIndicates if the message must be ordered in output- Default:
- false
-
quote
String quoteWhether 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:
- "\""
-
quoting
boolean quotingIndicate if the values (and headers) must be quoted when marshaling (optional)- Default:
- false
-
quotingEscaped
boolean quotingEscapedIndicate if the values must be escaped when quoting (optional)- Default:
- false
-
quotingOnlyWhenNeeded
boolean quotingOnlyWhenNeededIndicate 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. The quoting option must also be enabled.- Default:
- false
-
autospanLine
boolean autospanLineLast 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.- Default:
- false
-
allowEmptyStream
boolean allowEmptyStreamThe allowEmptyStream parameter will allow to prcoess the unavaiable stream for CSV file.- Default:
- false
-
endWithLineBreak
boolean endWithLineBreakThe endWithLineBreak parameter flags if the CSV file should end with a line break or not (optional)- Default:
- true
-
removeQuotes
boolean removeQuotesThe remove quotes parameter flags if unmarshalling should try to remove quotes for each field- Default:
- true
-
trimLine
boolean trimLineWhether to trim each line (stand and end) before parsing the line into data fields.- Default:
- true
-