use of org.dbflute.exception.DfXlsDataEmptyColumnDefException in project dbflute-core by dbflute.
the class DfXlsDataHandlerImpl method throwXlsDataColumnDefFailureException.
protected void throwXlsDataColumnDefFailureException(String dataDirectory, File file, DfDataTable dataTable) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The table specified on the xls file does not have (writable) columns.");
br.addItem("Advice");
br.addElement("Please confirm the column names about their spellings.");
br.addElement("And confirm the column definition of the table.");
// suppress duplicated info (show these elements in failure exception later)
// br.addItem("Data Directory");
// br.addElement(dataDirectory);
// br.addItem("Xls File");
// br.addElement(file);
br.addItem("Table");
br.addElement(dataTable.getTableDbName());
br.addItem("Defined Column");
final int columnSize = dataTable.getColumnSize();
if (columnSize > 0) {
for (int i = 0; i < dataTable.getColumnSize(); i++) {
final DfDataColumn dataColumn = dataTable.getColumn(i);
br.addElement(dataColumn.getColumnDbName());
}
} else {
br.addElement("(no column)");
}
final String msg = br.buildExceptionMessage();
throw new DfXlsDataEmptyColumnDefException(msg);
}
use of org.dbflute.exception.DfXlsDataEmptyColumnDefException in project dbflute-core by dbflute.
the class DfXlsDataWritingExceptionThrower method throwXlsDataColumnDefFailureException.
// -----------------------------------------------------
// Column Definition
// -----------------
public void throwXlsDataColumnDefFailureException(String dataDirectory, File file, DfDataTable dataTable) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The table specified on the xls file does not have (writable) columns.");
br.addItem("Advice");
br.addElement("Please confirm the column names about their spellings.");
br.addElement("And confirm the column definition of the table.");
// suppress duplicated info (show these elements in failure exception later)
// br.addItem("Data Directory");
// br.addElement(dataDirectory);
// br.addItem("Xls File");
// br.addElement(file);
br.addItem("Table");
br.addElement(dataTable.getTableDbName());
br.addItem("Defined Column");
final int columnSize = dataTable.getColumnSize();
if (columnSize > 0) {
for (int i = 0; i < dataTable.getColumnSize(); i++) {
final DfDataColumn dataColumn = dataTable.getColumn(i);
br.addElement(dataColumn.getColumnDbName());
}
} else {
br.addElement("(no column)");
}
final String msg = br.buildExceptionMessage();
throw new DfXlsDataEmptyColumnDefException(msg);
}
Aggregations