Package org.csvobjects.csv.mapping
Class CSVFieldMapping.Builder
java.lang.Object
org.csvobjects.csv.mapping.CSVFieldMapping.Builder
- Enclosing class:
CSVFieldMapping
Mutable builder for incrementally constructing an immutable
CSVFieldMapping from its declarative (parse-time) attributes.
The resolved attributes (formatter and beanReference)
are attached later via the with* methods on the built instance.-
Method Summary
Modifier and TypeMethodDescriptionattributeName(String newAttributeName) Sets the mapped POJO's attribute name corresponding to this field.beanReferenceName(String newBeanReferenceName) Sets the declarative name of a referenced bean mapping for this field.build()Builds the immutable field mapping.Sets the user defined name of this field.fieldPosition(int newFieldPosition) Sets this field's position in the CSV line.Sets the fully qualified Java type name of this field.reformatterName(String newReformatterName) Sets the declarative name of the formatter attached to this field.
-
Method Details
-
fieldName
Sets the user defined name of this field.- Parameters:
newFieldName- the name of this field- Returns:
- this builder
-
fieldType
Sets the fully qualified Java type name of this field.- Parameters:
newFieldType- the Java type name of this field- Returns:
- this builder
-
fieldPosition
Sets this field's position in the CSV line. Field positions start at 0.- Parameters:
newFieldPosition- the field's position in the CSV line- Returns:
- this builder
-
attributeName
Sets the mapped POJO's attribute name corresponding to this field.- Parameters:
newAttributeName- the mapped POJO's attribute name- Returns:
- this builder
-
reformatterName
Sets the declarative name of the formatter attached to this field.- Parameters:
newReformatterName- the declarative formatter name to set- Returns:
- this builder
-
beanReferenceName
Sets the declarative name of a referenced bean mapping for this field.- Parameters:
newBeanReferenceName- the declarative name of the referenced bean- Returns:
- this builder
-
build
Builds the immutable field mapping. The resolvedformatterandbeanReferenceattributes start unset (null).- Returns:
- the built field mapping
-