@Retention(value=RUNTIME) @Inherited @Target(value={FIELD,METHOD,ANNOTATION_TYPE}) public @interface Parsed
Conversion
implementations in package com.univocity.parsers.conversions
.
Commonly used for java beans processed using BeanProcessor
and/or BeanWriterProcessor
Implementation note: All annotations in @Parsed fields are processed by AnnotationHelper
Conversion
,
Conversions
,
BeanProcessor
,
BeanWriterProcessor
,
AnnotationHelper
Modifier and Type | Optional Element and Description |
---|---|
boolean |
applyDefaultConversion
Flag to indicate whether the parsed field should be converted automatically based on the field type.
|
String |
defaultNullRead
The default value to assign to this field in the parsed value is null
|
String |
defaultNullWrite
The default value to read from this field if it is null.
|
String[] |
field
The possible field names of a record.
|
int |
index
Field position in a parsed record
|
public abstract String[] field
CommonParserSettings.isHeaderExtractionEnabled()
, or manually set using
CommonSettings.setHeaders(String...)
for writing or parsing)public abstract int index
public abstract String defaultNullRead
The String literal "null" will be interpreted as a regular null.
Use "'null"' if you want the default value to be the string "null"
this value will have different effects depending on the field type:
Date
or Calendar
: if the null value is "now", the result of new Date() or Calendar.getInstance() will be used.
BigDecimal
and BigInteger
): if the null value contains a number, e.g. "50.01", it will be parsed and assigned to the field.
public abstract String defaultNullWrite
BeanWriterProcessor
.
The String literal "null" will be interpreted as a regular null
.
Use "'null"' if you want the default value to be the string "null"
public abstract boolean applyDefaultConversion
BigDecimal
, then BigDecimalConversion
will be used to convert Strings to BigDecimal when reading
and BigDecimal to String when writing. You may want to disable the default field conversion when using custom conversions through
DefaultConversionProcessor.convertFields(Conversion...)
,DefaultConversionProcessor.convertIndexes(Conversion...)
or
DefaultConversionProcessor.convertAll(Conversion...)
.Copyright © 2019 Univocity Software Pty Ltd. All rights reserved.