@Override @Deprecated public PropertyDescriptor findDescriptor(int col) { BeanField beanField = findField(col); if(beanField != null) { return findDescriptor(beanField.getField().getName()); } String columnName = getColumnName(col); if(StringUtils.isNotBlank(columnName)) { return findDescriptor(columnName); } return null; }
firstBeanField = findField(i); firstIndex = chooseMultivaluedFieldIndexFromHeaderIndex(i); String[] fields = firstBeanField != null subsequentBeanField = findField(displacedIndex); subsequentIndex = chooseMultivaluedFieldIndexFromHeaderIndex(displacedIndex); while(j < fields.length subsequentBeanField = findField(displacedIndex); subsequentIndex = chooseMultivaluedFieldIndexFromHeaderIndex(displacedIndex); subsequentBeanField = findField(i); subsequentIndex = chooseMultivaluedFieldIndexFromHeaderIndex(i); while(Objects.equals(firstBeanField, subsequentBeanField) && i < numColumns) { contents.add(StringUtils.EMPTY); subsequentBeanField = findField(++i); subsequentIndex = chooseMultivaluedFieldIndexFromHeaderIndex(i);
/** * Populates the field corresponding to the column position indicated of the * bean passed in according to the rules of the mapping strategy. * This method performs conversion on the input string and assigns the * result to the proper field in the provided bean. * * @param bean Object containing the field to be set. * @param value String containing the value to set the field to. * @param column The column position from the CSV file under which this * value was found. * @throws CsvDataTypeMismatchException When the result of data conversion returns * an object that cannot be assigned to the selected field * @throws CsvRequiredFieldEmptyException When a field is mandatory, but there is no * input datum in the CSV file * @throws CsvConstraintViolationException When the internal structure of * data would be violated by the data in the CSV file * @since 4.2 */ protected void setFieldValue(T bean, String value, int column) throws CsvDataTypeMismatchException, CsvRequiredFieldEmptyException, CsvConstraintViolationException { BeanField<T> beanField = findField(column); if (beanField != null) { beanField.setFieldValue(bean, value, findHeader(column)); } }