T object = type.newInstance();
int i = 0;
for (String columnName : header) {
Cell cell = row.getCell(i, Row.RETURN_BLANK_AS_NULL);
Col col = mapper.getColumn(columnName);
if (col == null) {
if (anyColumn != null) {
Set<Field> fields = ReflectionUtils.getAllFields(object.getClass(), withName(anyColumn.getFieldName()));
Field field = fields.iterator().next();
if (!isColumnInIgnoreList(field, columnName)) {
writeToAnyColumnField(field, object, cell, columnName);
}
}
} else {
Set<Field> fields = ReflectionUtils.getAllFields(object.getClass(), withName(col.getFieldName()));
Field field = fields.iterator().next();
writeToField(field, object, cell, col);
}
i++;
}