Package | Description |
---|---|
org.supercsv.cellprocessor |
Provides CellProcessor classes for conversion, formatting and parsing.
|
org.supercsv.cellprocessor.constraint |
Provides CellProcessor classes for enforcing constraints.
|
org.supercsv.cellprocessor.ift |
Provides CellProcessor interfaces, used to control/restrict how processors can be chained together.
|
org.supercsv.exception |
Provides the exceptions that may be thrown by Super CSV.
|
org.supercsv.io |
Provides the various readers and writers used to read/write Strings, Maps, or Objects.
|
org.supercsv.util |
Provides the utility classes used by Super CSV.
|
Modifier and Type | Class and Description |
---|---|
class |
CellProcessorAdaptor
Abstract super class containing shared behaviour of all cell processors.
|
class |
ConvertNullTo
This processor returns a specified default value if the input is null.
|
class |
FmtBool
Converts a Boolean into a formatted string.
|
class |
FmtDate
Converts a date into a formatted string using the
SimpleDateFormat class. |
class |
FmtNumber
Converts a double into a formatted string using the
DecimalFormat class and the default locale. |
class |
HashMapper
Maps from one object to another, by looking up a Map with the input as the key, and returning its
corresponding value.
|
class |
Optional
This processor is used to indicate that a cell is optional, and will avoid executing further processors if it
encounters null.
|
class |
ParseBigDecimal
Convert a String to a BigDecimal.
|
class |
ParseBool
Converts a String to a Boolean.
|
class |
ParseChar
Converts a String to a Character.
|
class |
ParseDate
Converts a String to a Date using the
SimpleDateFormat class. |
class |
ParseDouble
Converts a String to a Double.
|
class |
ParseInt
Converts a String to an Integer.
|
class |
ParseLong
Converts a String to a Long.
|
class |
StrReplace
Replaces each substring of the input string that matches the given regular expression with the given replacement.
|
class |
Token
This processor is used in the situations you want to be able to check for the presence of a "special
token".
|
class |
Trim
Ensure that Strings or String-representations of objects are trimmed (contain no surrounding whitespace).
|
class |
Truncate
Ensure that Strings or String-representations of objects are truncated to a maximum size.
|
Modifier and Type | Field and Description |
---|---|
protected CellProcessor |
CellProcessorAdaptor.next
the next processor in the chain
|
Constructor and Description |
---|
CellProcessorAdaptor(CellProcessor next)
Constructor used by CellProcessors that require CellProcessor chaining (further processing is required).
|
ConvertNullTo(Object returnValue,
CellProcessor next)
Constructs a new ConvertNullTo processor, which returns a specified default value if the input is
null.
|
Optional(CellProcessor next)
Constructs a new Optional processor, which when encountering null will return null ,
for all other values it will call the next processor in the chain.
|
ParseBigDecimal(CellProcessor next)
Constructs a new ParseBigDecimal processor, which converts a String to a BigDecimal then calls the next
processor in the chain.
|
ParseBigDecimal(DecimalFormatSymbols symbols,
CellProcessor next)
Constructs a new ParseBigDecimal processor, which converts a String to a BigDecimal using the supplied
DecimalFormatSymbols object to convert any decimal separator to a "." before creating the BigDecimal,
then calls the next processor in the chain.
|
Token(Object token,
Object returnValue,
CellProcessor next)
Constructs a new Token processor, which returns the supplied value if the token is encountered,
otherwise it passes the input unchanged to the next processor in the chain.
|
Modifier and Type | Class and Description |
---|---|
class |
DMinMax
Converts the input data to a Double and ensures that number is within a specified numeric range (inclusive).
|
class |
Equals
This constraint ensures that all input data is equal (to each other, or to a supplied constant value).
|
class |
ForbidSubStr
Converts the input to a String and ensures that it doesn't contain any of the supplied substrings.
|
class |
IsIncludedIn
This processor ensures that the input value belongs to a specific set of given values.
|
class |
LMinMax
Converts the input data to a Long and and ensures the value is between the supplied min and max values (inclusive).
|
class |
NotNull
This processor ensures that the input is not null.
|
class |
RequireHashCode
This processor converts the input to a String, and ensures that the input's hash function matches any of a given set
of hashcodes.
|
class |
RequireSubStr
Converts the input to a String and ensures that the input contains at least one of the specified substrings.
|
class |
Strlen
This processor ensures that the input String has a length equal to any of the supplied lengths.
|
class |
StrMinMax
This constraint ensures that the input data has a string length between the supplied min and max values (both
inclusive).
|
class |
StrNotNullOrEmpty
This processor checks if the input is null or an empty string, and raises an exception in that case.
|
class |
StrRegEx
This constraint ensures that the input data matches the given regular expression.
|
class |
Unique
Ensure that upon processing a CSV file (reading or writing), that values of the column all are unique.
|
class |
UniqueHashCode
Ensure that upon processing a CSV file (reading or writing), that values of the column are all unique.
|
Constructor and Description |
---|
Equals(CellProcessor next)
Constructs a new Equals processor, which ensures all input data is equal, then calls the the next
processor in the chain.
|
Equals(Object constantValue,
CellProcessor next)
Constructs a new Equals processor, which ensures all input data is equal to the supplied constant value,
then calls the the next processor in the chain.
|
ForbidSubStr(List<String> forbiddenSubStrings,
CellProcessor next)
Constructs a new ForbidSubStr processor which ensures the input doesn't contain any of the supplied
substrings, then calls the next processor in the chain.
|
ForbidSubStr(String[] forbiddenSubStrings,
CellProcessor next)
Constructs a new ForbidSubStr processor which ensures the input doesn't contain any of the supplied
substrings, then calls the next processor in the chain.
|
ForbidSubStr(String forbiddenSubString,
CellProcessor next)
Constructs a new ForbidSubStr processor which ensures the input doesn't contain the supplied substring,
then calls the next processor in the chain.
|
IsIncludedIn(Object[] possibleValues,
CellProcessor next)
Constructs a new IsIncludedIn processor, which ensures that the input value belongs to a specific set of
given values, then calls the next processor in the chain.
|
IsIncludedIn(Set<Object> possibleValues,
CellProcessor next)
Constructs a new IsIncludedIn processor, which ensures that the input value belongs to a specific set of
given values, then calls the next processor in the chain.
|
NotNull(CellProcessor next)
Constructs a new NotNull which ensures that the input is not null, then calls the next
processor in the chain.
|
RequireHashCode(int[] requiredHashcodes,
CellProcessor next)
Constructs a new RequireHashCode processor, which converts the input to a String, ensures that the
input's hash function matches any of a given set of hashcodes, then calls the next processor in the chain.
|
RequireHashCode(int requiredHashcode,
CellProcessor next)
Constructs a new RequireHashCode processor, which converts the input to a String, ensures that the
input's hash function matches the supplied hashcode, then calls the next processor in the chain.
|
RequireSubStr(List<String> requiredSubStrings,
CellProcessor next)
Converts the input to a String, ensures that the input contains at least one of the specified substrings, then
calls the next processor in the chain.
|
RequireSubStr(String[] requiredSubStrings,
CellProcessor next)
Converts the input to a String, ensures that the input contains at least one of the specified substrings, then
calls the next processor in the chain.
|
RequireSubStr(String requiredSubString,
CellProcessor next)
Converts the input to a String, ensures that the input contains the specified substring, then calls the next
processor in the chain.
|
Strlen(int[] requiredLengths,
CellProcessor next)
Constructs a new Strlen processor, which ensures that the input String has a length equal to any of the
supplied lengths, then calls the next processor in the chain.
|
Strlen(int requiredLength,
CellProcessor next)
Constructs a new Strlen processor, which ensures that the input String has a length equal to the
supplied length, then calls the next processor in the chain.
|
StrMinMax(long min,
long max,
CellProcessor next)
Constructs a new StrMinMax processor, which ensures that the input data has a string length between the
supplied min and max values (both inclusive), then calls the next processor in the chain.
|
StrNotNullOrEmpty(CellProcessor next)
Constructs a new StrNotNullOrEmpty processor, which checks for null/empty Strings, then calls the next
processor in the chain.
|
Unique(CellProcessor next)
Constructs a new Unique processor, which ensures that all rows in a column are unique, then calls the
next processor in the chain.
|
UniqueHashCode(CellProcessor next)
Constructs a new UniqueHashCode processor, which ensures that all rows in a column are unique, then
calls the next processor in the chain.
|
Modifier and Type | Interface and Description |
---|---|
interface |
BoolCellProcessor
Interface to indicate the a CellProcessor is capable of processing Boolean values.
|
interface |
DateCellProcessor
Interface to indicate the a CellProcessor is capable of processing Date values.
|
interface |
DoubleCellProcessor
Interface to indicate the a CellProcessor is capable of processing Double values.
|
interface |
LongCellProcessor
Interface to indicate the a CellProcessor is capable of processing Long values.
|
interface |
StringCellProcessor
Interface to indicate the a CellProcessor is capable of processing String values.
|
Modifier and Type | Method and Description |
---|---|
CellProcessor |
SuperCsvCellProcessorException.getProcessor()
Gets the processor that was executing.
|
Constructor and Description |
---|
SuperCsvCellProcessorException(Class<?> expectedType,
Object actualValue,
CsvContext context,
CellProcessor processor)
Constructs a new SuperCsvCellProcessorException to indicate that the value received by a CellProcessor
wasn't of the correct type.
|
SuperCsvCellProcessorException(String msg,
CsvContext context,
CellProcessor processor)
Constructs a new SuperCsvCellProcessorException.
|
SuperCsvCellProcessorException(String msg,
CsvContext context,
CellProcessor processor,
Throwable t)
Constructs a new SuperCsvCellProcessorException.
|
SuperCsvConstraintViolationException(String msg,
CsvContext context,
CellProcessor processor)
Constructs a new SuperCsvConstraintViolationException.
|
SuperCsvConstraintViolationException(String msg,
CsvContext context,
CellProcessor processor,
Throwable t)
Constructs a new SuperCsvConstraintViolationException.
|
Modifier and Type | Method and Description |
---|---|
List<Object> |
ICsvListReader.read(CellProcessor... processors)
Reads a row of a CSV file and returns a List of Objects containing each column.
|
List<Object> |
CsvListReader.read(CellProcessor... processors)
Reads a row of a CSV file and returns a List of Objects containing each column.
|
<T> T |
ICsvBeanReader.read(Class<T> clazz,
String[] nameMapping,
CellProcessor... processors)
Reads a row of a CSV file and populates an instance of the specified class, using the supplied name mapping to
map column values to the appropriate fields.
|
<T> T |
CsvBeanReader.read(Class<T> clazz,
String[] nameMapping,
CellProcessor... processors)
Reads a row of a CSV file and populates an instance of the specified class, using the supplied name mapping to
map column values to the appropriate fields.
|
Map<String,Object> |
ICsvMapReader.read(String[] nameMapping,
CellProcessor[] processors)
Reads a row of a CSV file into a Map, using the supplied name mapping to map column values to the appropriate map
entries, and the supplied processors to process the values before adding them to the Map.
|
Map<String,Object> |
CsvMapReader.read(String[] nameMapping,
CellProcessor[] processors)
Reads a row of a CSV file into a Map, using the supplied name mapping to map column values to the appropriate map
entries, and the supplied processors to process the values before adding them to the Map.
|
void |
ICsvListWriter.write(List<?> columns,
CellProcessor[] processors)
Writes a List of Objects as columns of a CSV file, performing any necessary processing beforehand.
|
void |
CsvListWriter.write(List<?> columns,
CellProcessor[] processors)
Writes a List of Objects as columns of a CSV file, performing any necessary processing beforehand.
|
void |
ICsvMapWriter.write(Map<String,?> values,
String[] nameMapping,
CellProcessor[] processors)
Writes the values of the Map as columns of a CSV file, using the supplied name mapping to map values to the
appropriate columns.
|
void |
CsvMapWriter.write(Map<String,?> values,
String[] nameMapping,
CellProcessor[] processors)
Writes the values of the Map as columns of a CSV file, using the supplied name mapping to map values to the
appropriate columns.
|
void |
ICsvBeanWriter.write(Object source,
String[] nameMapping,
CellProcessor[] processors)
Writes the fields of the object as columns of a CSV file, using the supplied name mapping to map fields to the
appropriate columns.
|
void |
CsvBeanWriter.write(Object source,
String[] nameMapping,
CellProcessor[] processors)
Writes the fields of the object as columns of a CSV file, using the supplied name mapping to map fields to the
appropriate columns.
|
Modifier and Type | Method and Description |
---|---|
static void |
Util.executeCellProcessors(List<Object> destination,
List<?> source,
CellProcessor[] processors,
int lineNo,
int rowNo)
Processes each element in the source List (using the corresponding processor chain in the processors array) and
adds it to the destination List.
|
Copyright © 2007-2012 Super CSV. All Rights Reserved.