org.supercsv.ext.builder.CsvBeanMapping Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of super-csv-annotation Show documentation
Show all versions of super-csv-annotation Show documentation
CSVのJavaライブラリであるSuperCSVに、アノテーション機能を追加したライブラリです。
/*
* CsvBeanMapping.java
* created in 2013/03/05
*
* (C) Copyright 2003-2013 GreenDay Project. All rights reserved.
*/
package org.supercsv.ext.builder;
import java.util.ArrayList;
import java.util.List;
import org.supercsv.cellprocessor.ift.CellProcessor;
/**
*
*
* @author T.TSUCHIE
*
*/
public class CsvBeanMapping {
private final Class type;
public CsvBeanMapping(final Class type) {
this.type = type;
}
private boolean header;
private List columns;
public String[] getHeader() {
List list = new ArrayList();
for(CsvColumnMapping column : columns) {
list.add(column.getLabel());
}
return list.toArray(new String[0]);
}
public String[] getNameMapping() {
List list = new ArrayList();
for(CsvColumnMapping column : columns) {
list.add(column.getColumnName());
}
return list.toArray(new String[0]);
}
public CellProcessor[] getInputCellProcessor() {
List list = new ArrayList();
for(CsvColumnMapping column : columns) {
list.add(column.getInputCellProcessor());
}
return list.toArray(new CellProcessor[0]);
}
public CellProcessor[] getOutputCellProcessor() {
List list = new ArrayList();
for(CsvColumnMapping column : columns) {
list.add(column.getOutputCellProcessor());
}
return list.toArray(new CellProcessor[0]);
}
public Class getType() {
return type;
}
public boolean isHeader() {
return header;
}
public void setHeader(final boolean header) {
this.header = header;
}
public List getColumns() {
return columns;
}
public void setColumns(final List columns) {
this.columns = columns;
}
}