Annotation Type Parsed

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean applyDefaultConversion
      Flag to indicate whether the parsed field should be converted automatically based on the field type.
      java.lang.String defaultNullRead
      The default value to assign to this field in the parsed value is null
      java.lang.String defaultNullWrite
      The default value to read from this field if it is null.
      java.lang.String[] field
      The possible field names of a record.
      int index
      Field position in a parsed record
    • Element Detail

      • field

        java.lang.String[] field
        The possible field names of a record. If multiple names are provided, the parser/writer will attempt to match the given names against the headers provided (i.e. headers found in the input when parsing with CommonParserSettings.isHeaderExtractionEnabled(), or manually set using CommonSettings.setHeaders(String...) for writing or parsing)
        Returns:
        the possible field names (optional if the index is provided)
        Default:
        {}
      • index

        int index
        Field position in a parsed record
        Returns:
        the position of this field (optional if the field name is provided)
        Default:
        -1
      • defaultNullRead

        java.lang.String defaultNullRead
        The default value to assign to this field in the parsed value is null

        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:

        • on fields of type Date or Calendar: if the null value is "now", the result of new Date() or Calendar.getInstance() will be used.
        • on numeric fields (primitives, wrappers and BigDecimal and BigInteger): if the null value contains a number, e.g. "50.01", it will be parsed and assigned to the field.
        • on boolean and Boolean fields: if the null value contains a String, the result of Boolean.valueOf(defaultNullRead()) will assigned to the field.
        • on char and Character fields: if the null value contains a String, the result of defaultNullRead().charAt(0) will assigned to the field. An exception will be thrown if the length of this String is different than 1
        Returns:
        the default String to return when the parsed value is null
        Default:
        "null"
      • defaultNullWrite

        java.lang.String defaultNullWrite
        The default value to read from this field if it is null. Used for writing to an output by 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"

        Returns:
        default String to write when the input is null.
        Default:
        "null"