Package com.opencsv.bean
package com.opencsv.bean
A bean binding interface for use with opencsv.
- See Also:
-
ClassDescriptionAbstractBeanField<T,
I> This base bean takes over the responsibility of converting the supplied string to the proper type for the destination field and setting the destination field.This implementation ofCsvConverter
provides a reasonable default forCsvConverter.convertToWrite(java.lang.Object)
as well as a couple of common fields.AbstractFieldMap<I,K extends Comparable<K>, C extends ComplexFieldMapEntry<I, K, T>, T> A base class to collect all generalized components of aFieldMap
.AbstractFieldMapEntry<I,K extends Comparable<K>, T> Collects common aspects of aComplexFieldMapEntry
.AbstractMappingStrategy<I,K extends Comparable<K>, C extends ComplexFieldMapEntry<I, K, T>, T> This class collects as many generally useful parts of the implementation of a mapping strategy as possible.Encapsulates a bean type and all of the member variables that need to be recursed into.BeanField<T,I> Used to extend theField
class to include functionality that opencsv requires.BeanFieldJoin<T,I> This class is used for combining multiple columns of the input, possibly with multiple identically named columns, into one field.Implements aBeanFieldJoin
with aInteger
for an index.Implements aBeanFieldJoin
with aString
for an index.BeanFieldSingleValue<T,I> This class concerns itself with handling single-valued bean fields.BeanFieldSplit<T,I> This class concerns itself with handling collection-valued bean fields.BeanVerifier<T>Classes implementing this interface may be used to verify and filter beans after creation, but before being passed back to the calling application.Allows for the mapping of columns with their positions.Builder for aColumnPositionMappingStrategy
.ComplexFieldMapEntry<I,K extends Comparable<K>, T> Defines the basic functionality necessary for using a many-to-one mapping between columns of a CSV file and bean fields.This class converts an input ISO 4217 currency code to aCurrency
instance.This class converts an input to a date type.This class converts an input to an enumeration type and vice versa.This converter class is used in combination withCsvNumber
, that is, when number inputs and outputs should be formatted.This class wraps fields from the reflection API in order to handle translation of primitive types and to add a "required" flag.This class converts an String to aUUID
instance.Joins the values of multiple columns from the input into one bean field based on a pattern for the column names.This annotation is the container annotation forCsvBindAndJoinByName
.Joins the values of multiple columns from the input into one bean field based on a selection of column positions.This annotation is the container annotation forCsvBindAndJoinByPosition
.This annotation interprets one field of the input as a collection that will be split up into its components and assigned to a collection-based bean field.This annotation is the container annotation forCsvBindAndSplitByName
.This annotation interprets one field of the input as a collection that will be split up into its components and assigned to a collection-based bean field.This annotation is the container annotation forCsvBindAndSplitByPosition
.Specifies a binding between a column name of the CSV input and a field in a bean.This annotation is the container annotation forCsvBindByName
.Specifies a binding between a column number of the CSV input and a field in a bean.This annotation is the container annotation forCsvBindByPosition
.Classes implementing this interface perform a conversion from String to some type on reading and some type to String on writing.Allows us to specify a class that will perform the translation from source to destination.This annotation is the container annotation forCsvCustomBindByName
.Allows us to specify a class that will perform the translation from source to destination.This annotation is the container annotation forCsvCustomBindByPosition
.This annotation indicates that the destination field is an expression of time.This annotation is the container annotation forCsvDate
.Instructs opencsv to ignore a field and any annotations present.This annotation indicates that the destination field is a number that is specially formatted.This annotation is the container annotation forCsvNumber
.Instructs a mapping strategy to look inside a member variable for further mapping annotations.CsvToBean<T>Converts CSV data to objects.This class makes it possible to bypass all the intermediate steps and classes in setting up to read from a CSV source to a list of beans.Filters allow lines of input to be ignored before a bean is created.FieldAccess<T>Encapsulates the logic for accessing member variables of classes.FieldMap<I,K extends Comparable<K>, C extends ComplexFieldMapEntry<I, K, T>, T> Defines the basic characteristics of a map between field identifiers and their associatedBeanField
s.This class maintains a mapping from header names out of a CSV file to bean fields.Represents one entry inFieldMapByName
.This class maintains a mapping from column position out of a CSV file to bean fields.Represents one entry inFieldMapByPosition
.A mapping strategy that tries to make the best match between header names and non-annotated member variables.This is a simple class for grouping header name, member variable name, and the result of fuzzy matching in one sortable place.Builder for aFuzzyMappingStrategy
.Maps data to objects using the column names in the first row of the CSV file as reference.Builder for aHeaderColumnNameMappingStrategy
.Expands onHeaderColumnNameMappingStrategy
by allowing the user to pass in a map of column names to bean names.Builder for aHeaderColumnNameMappingStrategy
.A bi-directional mapping between column positions and header names.This class serves as a location to collect code common to a mapping strategy that maps header names to member variables.The interface for the classes that handle translating between the columns in the CSV file to an actual object.Maps any column position matching a range definition to aBeanField
.Maps any header name matching a regular expression to aBeanField
.This class writes beans out in CSV format to aWriter
, keeping state information and making an intelligent guess at the mapping strategy to be applied.This is a builder for StatefulBeanToCsv, allowing one to set all parameters necessary for writing a CSV file.