public class HeaderColumnNameMappingStrategy extends java.lang.Object implements MappingStrategy
Modifier and Type | Field and Description |
---|---|
protected java.beans.PropertyDescriptor[] |
descriptors |
protected java.lang.String[] |
header |
protected java.lang.Class |
type |
Constructor and Description |
---|
HeaderColumnNameMappingStrategy() |
Modifier and Type | Method and Description |
---|---|
void |
captureHeader(CSVReader reader)
Implemention of this method can grab the header line before parsing begins to use to map columns
to bean properties.
|
java.lang.Object |
createBean() |
java.beans.PropertyDescriptor |
findDescriptor(int col)
Implementation will have to return a property descriptor from a bean based on the current column.
|
protected java.beans.PropertyDescriptor |
findDescriptor(java.lang.String name) |
protected java.lang.String |
getColumnName(int col) |
java.lang.Class |
getType() |
protected java.beans.PropertyDescriptor[] |
loadDescriptors(java.lang.Class cls) |
protected boolean |
matches(java.lang.String name,
java.beans.PropertyDescriptor desc) |
void |
setType(java.lang.Class type) |
protected java.lang.String[] header
protected java.beans.PropertyDescriptor[] descriptors
protected java.lang.Class type
public void captureHeader(CSVReader reader) throws java.io.IOException
MappingStrategy
captureHeader
in interface MappingStrategy
java.io.IOException
public java.beans.PropertyDescriptor findDescriptor(int col) throws java.beans.IntrospectionException
MappingStrategy
findDescriptor
in interface MappingStrategy
java.beans.IntrospectionException
protected java.lang.String getColumnName(int col)
protected java.beans.PropertyDescriptor findDescriptor(java.lang.String name) throws java.beans.IntrospectionException
java.beans.IntrospectionException
protected boolean matches(java.lang.String name, java.beans.PropertyDescriptor desc)
protected java.beans.PropertyDescriptor[] loadDescriptors(java.lang.Class cls) throws java.beans.IntrospectionException
java.beans.IntrospectionException
public java.lang.Object createBean() throws java.lang.InstantiationException, java.lang.IllegalAccessException
createBean
in interface MappingStrategy
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.lang.Class getType()
public void setType(java.lang.Class type)