id));
}
nextRowNumber = 1;
Map<PropertyName, Integer> results = new LinkedHashMap<PropertyName, Integer>();
for (Iterator<Cell> iter = row.cellIterator(); iter.hasNext();) {
Cell cell = iter.next();
int type = cell.getCellType();
if (type == Cell.CELL_TYPE_BLANK) {
continue;
}
if (type != Cell.CELL_TYPE_STRING || cell.getStringCellValue().isEmpty()) {
throw new IOException(MessageFormat.format(
"最初の行はプロパティ名を文字列で指定してください: (id={0}, column={1})",
id,
cell.getColumnIndex() + 1));
}
String name = cell.getStringCellValue();
PropertyName property = toPropertyName(cell, name);
if (definition.getType(property) == null) {
throw new IOException(MessageFormat.format(
"{0}にプロパティ\"{1}\"は定義されていません: (id={2}, column={3})",
definition.getModelClass().getName(),
property,
id,
cell.getColumnIndex() + 1));
}
results.put(property, cell.getColumnIndex());
}
if (results.isEmpty()) {
throw new IOException(MessageFormat.format(
"最初の行はプロパティ名の一覧でなければなりません: (id={0})",
id));