@Override protected Object chooseMultivaluedFieldIndexFromHeaderIndex(int index) { String[] s = headerIndex.getHeaderIndex(); return index >= s.length ? null: s[index]; }
/** * Retrieves the column mappings. * * @return String array with the column mappings. */ public String[] getColumnMapping() { return headerIndex.getHeaderIndex(); }
/** * This method generates a header that can be used for writing beans of the * type provided back to a file. * <p>The ordering of the headers is determined by the * {@link com.opencsv.bean.FieldMap} in use.</p> * <p>This method should be called first by all overriding classes to make * certain {@link #headerIndex} is properly initialized.</p> */ // The rest of the Javadoc is inherited @Override public String[] generateHeader(T bean) throws CsvRequiredFieldEmptyException { if(type == null) { throw new IllegalStateException(ResourceBundle .getBundle(ICSVParser.DEFAULT_BUNDLE_NAME, errorLocale) .getString("type.before.header")); } // Always take what's been given or previously determined first. if(headerIndex.isEmpty()) { String[] header = getFieldMap().generateHeader(bean); headerIndex.initializeHeaderIndex(header); return header; } // Otherwise, put headers in the right places. return headerIndex.getHeaderIndex(); }