Top Description Interfaces Annotations Classes
[default module]

Package com.opencsv.bean


A bean binding interface for use with opencsv.
See Also
opencsv.sourceforge.net

Interface Summary

Modifier and TypeInterface and Description
public interface
BeanField<
Type of the bean being populated
T
,
Type of the index into a multivalued field
I
>

Used to extend the java.lang.reflect.Field class to include functionality that opencsv requires.

public interface
BeanVerifier<
The type of bean being verified
T
>

Classes implementing this interface may be used to verify and filter beans after creation, but before being passed back to the calling application.

public interface
ComplexFieldMapEntry<
The initializer type used to build the many-to-one mapping
I
,
The type of the key used for indexing
K extends Comparable<K>
,
The type of the bean being converted
T
>

Defines the basic functionality necessary for using a many-to-one mapping between columns of a CSV file and bean fields.

public interface
CsvConverter

Classes implementing this interface perform a conversion from String to some type on reading and some type to String on writing.

public interface
CsvToBeanFilter

Filters allow lines of input to be ignored before a bean is created.

public interface
FieldMap<
The initializer type used to build the many-to-one mapping
I
,
Type of the field identifier (key)
K extends Comparable<K>
,
Type of the ComplexFieldMapEntry used. This is specified as a parameter so we can provide type safety and polymorphism through a generic interface on the one hand, and still extend specific implementations with methods needed for that type of complex mapping without having to add every such method to the generic interface.
C extends ComplexFieldMapEntry<I, K, T>
,
The type of the bean
T
>

Defines the basic characteristics of a map between field identifiers and their associated BeanFields.

public interface
MappingStrategy<
Type of object you are converting the data to.
T
>

The interface for the classes that handle translating between the columns in the CSV file to an actual object.

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
CsvBindAndJoinByName

Joins the values of multiple columns from the input into one bean field based on a pattern for the column names.

public @interface
CsvBindAndJoinByNames

This annotation is the container annotation for CsvBindAndJoinByName.

public @interface
CsvBindAndJoinByPosition

Joins the values of multiple columns from the input into one bean field based on a selection of column positions.

public @interface
CsvBindAndJoinByPositions

This annotation is the container annotation for CsvBindAndJoinByPosition.

public @interface
CsvBindAndSplitByName

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.

public @interface
CsvBindAndSplitByNames

This annotation is the container annotation for CsvBindAndSplitByName.

public @interface
CsvBindAndSplitByPosition

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.

public @interface
CsvBindAndSplitByPositions

This annotation is the container annotation for CsvBindAndSplitByPosition.

public @interface
CsvBindByName

Specifies a binding between a column name of the CSV input and a field in a bean.

public @interface
CsvBindByNames

This annotation is the container annotation for CsvBindByName.

public @interface
CsvBindByPosition

Specifies a binding between a column number of the CSV input and a field in a bean.

public @interface
CsvBindByPositions

This annotation is the container annotation for CsvBindByPosition.

public @interface
CsvCustomBindByName

Allows us to specify a class that will perform the translation from source to destination.

public @interface
CsvCustomBindByNames

This annotation is the container annotation for CsvCustomBindByName.

public @interface
CsvCustomBindByPosition

Allows us to specify a class that will perform the translation from source to destination.

public @interface
CsvCustomBindByPositions

This annotation is the container annotation for CsvCustomBindByPosition.

public @interface
CsvDate

This annotation indicates that the destination field is an expression of time.

public @interface
CsvDates

This annotation is the container annotation for CsvDate.

public @interface
CsvIgnore

Instructs opencsv to ignore a field and any annotations present.

public @interface
CsvNumber

This annotation indicates that the destination field is a number that is specially formatted.

public @interface
CsvNumbers

This annotation is the container annotation for CsvNumber.

public @interface
CsvRecurse

Instructs a mapping strategy to look inside a member variable for further mapping annotations.

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractBeanField<
Type of the bean being populated
T
,
Type of the index into a multivalued field
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.

public abstract class
AbstractCsvConverter

This implementation of CsvConverter provides a reasonable default for CsvConverter#convertToWrite(java.lang.Object) as well as a couple of common fields.

public abstract class
AbstractFieldMap<
The initializer type used to build the many-to-one mapping
I
,
Type of the field identifier (key)
K extends Comparable<K>
,
Type of the ComplexFieldMapEntry used
C extends ComplexFieldMapEntry<I, K, T>
,
Type of the bean being converted
T
>

A base class to collect all generalized components of a FieldMap.

public abstract class
AbstractFieldMapEntry<
The initializer type used to build the many-to-one mapping
I
,
The type of the key used for indexing
K extends Comparable<K>
,
The type of the bean being converted
T
>

Collects common aspects of a ComplexFieldMapEntry.

public abstract class
AbstractMappingStrategy<
The initializer type used to build the internal many-to-one mapping
I
,
The type of the key used for internal indexing
K extends Comparable<K>
,
The type of the internal many-to-one mapping
C extends ComplexFieldMapEntry<I, K, T>
,
Type of object that is being processed.
T
>

This class collects as many generally useful parts of the implementation of a mapping strategy as possible.

public abstract class
public abstract class
BeanFieldJoin<
The type of the bean being populated
T
, I>

This class is used for combining multiple columns of the input, possibly with multiple identically named columns, into one field.

public class
BeanFieldJoinIntegerIndex<
The type of the bean being populated
T
>

Implements a BeanFieldJoin with a java.lang.Integer for an index.

public class
BeanFieldJoinStringIndex<
The type of the bean being populated
T
>

Implements a BeanFieldJoin with a java.lang.String for an index.

public class
BeanFieldSingleValue<
The type of the bean being populated
T
,
Type of the index into a multivalued field
I
>

This class concerns itself with handling single-valued bean fields.

public class
BeanFieldSplit<
The type of the bean being populated
T
,
Type of the index into a multivalued field
I
>

This class concerns itself with handling collection-valued bean fields.

public class
ColumnPositionMappingStrategy<
Type of object that is being processed.
T
>

Allows for the mapping of columns with their positions.

public class
ColumnPositionMappingStrategyBuilder<
The type of the bean being processed
T
>

Builder for a ColumnPositionMappingStrategy.

public class
ConverterCurrency

This class converts an input ISO 4217 currency code to a java.util.Currency instance.

public class
ConverterDate

This class converts an input to a date type.

public class
ConverterEnum

This class converts an input to an enumeration type and vice versa.

public class
ConverterNumber

This converter class is used in combination with CsvNumber, that is, when number inputs and outputs should be formatted.

public class
ConverterPrimitiveTypes

This class wraps fields from the reflection API in order to handle translation of primitive types and to add a "required" flag.

public class
ConverterUUID

This class converts an String to a java.util.UUID instance.

public class
CsvToBean<
Class to convert the objects to.
T
>

Converts CSV data to objects.

public class
CsvToBeanBuilder<
Type of the bean to be populated
T
>

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.

public class
FieldAccess<
The type of the member variable being accessed
T
>

Encapsulates the logic for accessing member variables of classes.

public class
FieldMapByName<
Type of the bean being converted
T
>

This class maintains a mapping from header names out of a CSV file to bean fields.

public class
FieldMapByNameEntry<
The type of the bean being converted
T
>

Represents one entry in FieldMapByName.

public class
FieldMapByPosition<
Type of the bean being converted
T
>

This class maintains a mapping from column position out of a CSV file to bean fields.

public class
FieldMapByPositionEntry<
The type of the bean being converted
T
>

Represents one entry in FieldMapByPosition.

public class
FuzzyMappingStrategy<
The type of bean being processed
T
>

A mapping strategy that tries to make the best match between header names and non-annotated member variables.

public class
FuzzyMappingStrategyBuilder<
The type of the bean being processed
T
>

Builder for a FuzzyMappingStrategy.

public class
HeaderColumnNameMappingStrategy<
Type of the bean to be returned
T
>

Maps data to objects using the column names in the first row of the CSV file as reference.

public class
HeaderColumnNameMappingStrategyBuilder<
The type of the bean being processed
T
>

Builder for a HeaderColumnNameMappingStrategy.

public class
HeaderColumnNameTranslateMappingStrategy<
Class to be mapped.
T
>

Expands on HeaderColumnNameMappingStrategy by allowing the user to pass in a map of column names to bean names.

public class
HeaderColumnNameTranslateMappingStrategyBuilder<
The type of the bean being processed
T
>

Builder for a HeaderColumnNameMappingStrategy.

public class
HeaderIndex

A bi-directional mapping between column positions and header names.

public abstract class
HeaderNameBaseMappingStrategy<
The type of bean being created or written
T
>

This class serves as a location to collect code common to a mapping strategy that maps header names to member variables.

public class
PositionToBeanField<
Type of the bean being converted
T
>

Maps any column position matching a range definition to a BeanField.

public class
RegexToBeanField<
The type of the bean being converted
T
>

Maps any header name matching a regular expression to a BeanField.

public class
StatefulBeanToCsv<
Type of the bean to be written
T
>

This class writes beans out in CSV format to a java.io.Writer, keeping state information and making an intelligent guess at the mapping strategy to be applied.

public class
StatefulBeanToCsvBuilder<
The type of the beans being written
T
>

This is a builder for StatefulBeanToCsv, allowing one to set all parameters necessary for writing a CSV file.