T
- - Type of object that is being processed.public class BeanToCsv<T> extends Object
Constructor and Description |
---|
BeanToCsv()
default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String[] |
processHeader(MappingStrategy<T> mapper)
Processes the header for the bean.
|
protected String[] |
processObject(List<Method> getters,
Object bean)
Retrieve all the information out of an object.
|
boolean |
write(MappingStrategy<T> mapper,
CSVWriter csv,
List<?> objects)
Writes all the objects, one at a time, to the csvWriter using the passed in Strategy.
|
boolean |
write(MappingStrategy<T> mapper,
Writer writer,
List<?> objects)
Writes all the objects, one at a time, to a created csvWriter using the passed in Strategy.
|
public boolean write(MappingStrategy<T> mapper, Writer writer, List<?> objects)
mapper
- - Mapping strategy for the bean.writer
- - Writer object used to construct the CSVWriter.objects
- - list of objects to write.public boolean write(MappingStrategy<T> mapper, CSVWriter csv, List<?> objects)
mapper
- - Mapping strategy for the bean.csv
- - CSVWriterobjects
- - list of objects to write.protected String[] processHeader(MappingStrategy<T> mapper) throws IntrospectionException
mapper
- MappingStrategy for BeanIntrospectionException
- - thrown if there is an failure in Introspection.protected String[] processObject(List<Method> getters, Object bean) throws IntrospectionException, IllegalAccessException, InvocationTargetException
getters
- - List of methods to retrieve information.bean
- - object to get the information from.IntrospectionException
- - thrown by error in introspection.IllegalAccessException
- - thrown by error in introspection.InvocationTargetException
- - thrown by error in introspection.Copyright © 2015. All rights reserved.