Package com.opencsv.bean
A bean binding interface for use with opencsv.
- See Also:
- opencsv.sourceforge.net
-
Interface Summary Interface Description BeanField<T,I> Used to extend theField
class to include functionality that opencsv requires.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.ComplexFieldMapEntry<I,K extends java.lang.Comparable<K>,T> Defines the basic functionality necessary for using a many-to-one mapping between columns of a CSV file and bean fields.CsvConverter Classes implementing this interface perform a conversion from String to some type on reading and some type to String on writing.CsvToBeanFilter Filters allow lines of input to be ignored before a bean is created.FieldMap<I,K extends java.lang.Comparable<K>,C extends ComplexFieldMapEntry<I,K,T>,T> Defines the basic characteristics of a map between field identifiers and their associatedBeanField
s.MappingStrategy<T> The interface for the classes that handle translating between the columns in the CSV file to an actual object. -
Class Summary Class Description AbstractBeanField<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.AbstractCsvConverter This implementation ofCsvConverter
provides a reasonable default forCsvConverter.convertToWrite(java.lang.Object)
as well as a couple of common fields.AbstractFieldMap<I,K extends java.lang.Comparable<K>,C extends ComplexFieldMapEntry<I,K,T>,T> A base class to collect all generalized components of aFieldMap
.AbstractFieldMapEntry<I,K extends java.lang.Comparable<K>,T> Collects common aspects of aComplexFieldMapEntry
.AbstractMappingStrategy<I,K extends java.lang.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.AbstractMappingStrategy.RecursiveType Encapsulates a bean type and all of the member variables that need to be recursed into.BeanFieldJoin<T,I> This class is used for combining multiple columns of the input, possibly with multiple identically named columns, into one field.BeanFieldJoinIntegerIndex<T> Implements aBeanFieldJoin
with aInteger
for an index.BeanFieldJoinStringIndex<T> 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.ColumnPositionMappingStrategy<T> Allows for the mapping of columns with their positions.ColumnPositionMappingStrategyBuilder<T> Builder for aColumnPositionMappingStrategy
.ConverterCurrency This class converts an input ISO 4217 currency code to aCurrency
instance.ConverterDate This class converts an input to a date type.ConverterEnum This class converts an input to an enumeration type and vice versa.ConverterNumber This converter class is used in combination withCsvNumber
, that is, when number inputs and outputs should be formatted.ConverterPrimitiveTypes This class wraps fields from the reflection API in order to handle translation of primitive types and to add a "required" flag.ConverterUUID This class converts an String to aUUID
instance.CsvToBean<T> Converts CSV data to objects.CsvToBeanBuilder<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.FieldAccess<T> Encapsulates the logic for accessing member variables of classes.FieldMapByName<T> This class maintains a mapping from header names out of a CSV file to bean fields.FieldMapByNameEntry<T> Represents one entry inFieldMapByName
.FieldMapByPosition<T> This class maintains a mapping from column position out of a CSV file to bean fields.FieldMapByPositionEntry<T> Represents one entry inFieldMapByPosition
.FuzzyMappingStrategy<T> A mapping strategy that tries to make the best match between header names and non-annotated member variables.FuzzyMappingStrategy.FuzzyComparison This is a simple class for grouping header name, member variable name, and the result of fuzzy matching in one sortable place.FuzzyMappingStrategyBuilder<T> Builder for aFuzzyMappingStrategy
.HeaderColumnNameMappingStrategy<T> Maps data to objects using the column names in the first row of the CSV file as reference.HeaderColumnNameMappingStrategyBuilder<T> Builder for aHeaderColumnNameMappingStrategy
.HeaderColumnNameTranslateMappingStrategy<T> Expands onHeaderColumnNameMappingStrategy
by allowing the user to pass in a map of column names to bean names.HeaderColumnNameTranslateMappingStrategyBuilder<T> Builder for aHeaderColumnNameMappingStrategy
.HeaderIndex A bi-directional mapping between column positions and header names.HeaderNameBaseMappingStrategy<T> This class serves as a location to collect code common to a mapping strategy that maps header names to member variables.PositionToBeanField<T> Maps any column position matching a range definition to aBeanField
.RegexToBeanField<T> Maps any header name matching a regular expression to aBeanField
.StatefulBeanToCsv<T> 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.StatefulBeanToCsvBuilder<T> This is a builder for StatefulBeanToCsv, allowing one to set all parameters necessary for writing a CSV file. -
Annotation Types Summary Annotation Type Description CsvBindAndJoinByName Joins the values of multiple columns from the input into one bean field based on a pattern for the column names.CsvBindAndJoinByNames This annotation is the container annotation forCsvBindAndJoinByName
.CsvBindAndJoinByPosition Joins the values of multiple columns from the input into one bean field based on a selection of column positions.CsvBindAndJoinByPositions This annotation is the container annotation forCsvBindAndJoinByPosition
.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.CsvBindAndSplitByNames This annotation is the container annotation forCsvBindAndSplitByName
.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.CsvBindAndSplitByPositions This annotation is the container annotation forCsvBindAndSplitByPosition
.CsvBindByName Specifies a binding between a column name of the CSV input and a field in a bean.CsvBindByNames This annotation is the container annotation forCsvBindByName
.CsvBindByPosition Specifies a binding between a column number of the CSV input and a field in a bean.CsvBindByPositions This annotation is the container annotation forCsvBindByPosition
.CsvCustomBindByName Allows us to specify a class that will perform the translation from source to destination.CsvCustomBindByNames This annotation is the container annotation forCsvCustomBindByName
.CsvCustomBindByPosition Allows us to specify a class that will perform the translation from source to destination.CsvCustomBindByPositions This annotation is the container annotation forCsvCustomBindByPosition
.CsvDate This annotation indicates that the destination field is an expression of time.CsvDates This annotation is the container annotation forCsvDate
.CsvIgnore Instructs opencsv to ignore a field and any annotations present.CsvNumber This annotation indicates that the destination field is a number that is specially formatted.CsvNumbers This annotation is the container annotation forCsvNumber
.CsvRecurse Instructs a mapping strategy to look inside a member variable for further mapping annotations.