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.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.ConverterDate This class converts an input to a date type.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.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.HeaderColumnNameMappingStrategy<T> Maps data to objects using the column names in the first row of the CSV file as reference.HeaderColumnNameTranslateMappingStrategy<T> Expands onHeaderColumnNameMappingStrategy
by allowing the user to pass in a map of column names to bean names.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.OpencsvUtils This class is meant to be a collection of general purpose static methods useful in processing mapping strategies.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.CsvBindAndJoinByPosition Joins the values of multiple columns from the input into one bean field based on a selection of column positions.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.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.CsvBindByName Specifies a binding between a column name of the CSV input and a field in a bean.CsvBindByPosition Specifies a binding between a column number of the CSV input and a field in a bean.CsvCustomBindByName Allows us to specify a class that will perform the translation from source to destination.CsvCustomBindByPosition Allows us to specify a class that will perform the translation from source to destination.CsvDate This annotation indicates that the destination field is an expression of time.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.CsvRecurse Instructs a mapping strategy to look inside a member variable for further mapping annotations.