Annotation Type CsvNumber
CsvBindByName
,
CsvBindByPosition
, etc.), it is used for the conversion. The
following types are supported:
- byte /
Byte
- double /
Double
- float /
Float
- int /
Integer
- long /
Long
- short /
Short
BigDecimal
BigInteger
- Since:
- 4.2
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]
A profile can be used to annotate the same field differently for different inputs or outputs.A number format string.boolean
Whether or not the same format string is used for writing as for reading.
-
Element Details
-
value
String valueA decimal format string. This must be a localized pattern understood byDecimalFormat
. The locale is gleaned from one of the other CSV-related annotations if present there, or failing that, is the default locale for the JVM. If your code might run under different locales, you are strongly encouraged to always specify a locale for conversions, otherwise your code will behave unpredictably.- Returns:
- The format string for parsing input
-
writeFormatEqualsReadFormat
boolean writeFormatEqualsReadFormatWhether or not the same format string is used for writing as for reading. If this is true,value()
is used for both reading and writing andwriteFormat()
is ignored.- Returns:
- Whether the read format is used for writing as well
- Since:
- 5.0
- Default:
true
-
writeFormat
String writeFormatA number format string. The default value is blank and only exists to make sure the parameter is optional.- Returns:
- The format string for formatting output
- Since:
- 5.0
- See Also:
- Default:
""
-
profiles
String[] profilesA profile can be used to annotate the same field differently for different inputs or outputs.Perhaps you have multiple input sources, and they all use different header names or positions for the same data. With profiles, you don't have to create different beans with the same fields and different annotations for each input. Simply annotate the same field multiple times and specify the profile when you parse the input.
The same applies to output: if you want to be able to represent the same data in multiple CSV formats (that is, with different headers or orders), annotate the bean fields multiple times with different profiles and specify which profile you want to use on writing.
Results are undefined if profile names are not unique.
If the same configuration applies to multiple profiles, simply list all applicable profile names here. This parameter is an array of strings.
The empty string, which is the default value, specifies the default profile and will be used if no annotation for the specific profile being used can be found, or if no profile is specified.
- Returns:
- The names of the profiles this configuration is for
- Since:
- 5.4
- Default:
{""}
-