Annotation Type Headers
-
@Retention(RUNTIME) @Inherited @Target({TYPE,ANNOTATION_TYPE}) public @interface Headers
TheHeaders
annotation allows java beans to configure how to handle field names in a given input/outputWith this annotation, you can configure the sequence of headers to use when reading/writing:
- when reading, the given
sequence()
of header names will be used to refer to each column, irrespective of whether or not the input contains a header row. If empty, and no headers have been defined inCommonSettings.getHeaders()
, the parser will automatically use the first row in the input as the header row, unless the fields in the bean have been annotated usingParsed.index()
only. - when writing, the given
sequence()
of names will be used to refer to each column and will be used for writing the header row ifwrite()
is enabled. If empty, and no headers have been defined inCommonSettings.getHeaders()
, the names given by attributes annotated withParsed.field()
will be used.
This annotation has no effect if
CommonSettings.isAutoConfigurationEnabled()
evaluates tofalse
.- See Also:
BeanWriterProcessor
,BeanProcessor
- when reading, the given
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
extract
Indicates whether the first row of on the input should be extracted as a header row.java.lang.String[]
sequence
Returns the sequence of header names in the input/outputboolean
write
Indicates whether a row with headers should be written to the output.
-