Added @Override annotations.
This commit is contained in:
committed by
Michael Minella
parent
85dab9d0eb
commit
24e9166fff
@@ -27,11 +27,6 @@ import org.springframework.batch.item.ParseException;
|
||||
*/
|
||||
public class ExcelFileParseException extends ParseException {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3939056060545496492L;
|
||||
|
||||
private final String filename;
|
||||
private final String sheet;
|
||||
private final String[] row;
|
||||
|
||||
@@ -43,6 +43,7 @@ public class JxlSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int getNumberOfRows() {
|
||||
return this.delegate.getRows();
|
||||
}
|
||||
@@ -50,6 +51,7 @@ public class JxlSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String[] getHeader() {
|
||||
return this.getRow(0);
|
||||
}
|
||||
@@ -57,6 +59,7 @@ public class JxlSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String[] getRow(final int rowNumber) {
|
||||
final Cell[] row = this.delegate.getRow(rowNumber);
|
||||
return JxlUtils.extractContents(row);
|
||||
@@ -65,6 +68,7 @@ public class JxlSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.delegate.getName();
|
||||
}
|
||||
@@ -72,6 +76,7 @@ public class JxlSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int getNumberOfColumns() {
|
||||
return this.delegate.getColumns();
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public class DefaultRowMapper<T> implements RowMapper<T>, InitializingBean {
|
||||
private RowTokenizer rowTokenizer = new DefaultRowTokenizer();
|
||||
private FieldSetMapper<T> fieldSetMapper;
|
||||
|
||||
@Override
|
||||
public T mapRow(final Sheet sheet, final String[] row, final int rowNum) throws Exception {
|
||||
return this.fieldSetMapper.mapFieldSet(this.rowTokenizer.tokenize(sheet, row));
|
||||
}
|
||||
@@ -56,6 +57,7 @@ public class DefaultRowMapper<T> implements RowMapper<T>, InitializingBean {
|
||||
this.rowTokenizer = rowTokenizer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.notNull(this.rowTokenizer, "The RowTokenizer must be set");
|
||||
Assert.notNull(this.fieldSetMapper, "The FieldSetMapper must be set");
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.batch.item.excel.Sheet;
|
||||
*/
|
||||
public class PassThroughRowMapper implements RowMapper<String[]> {
|
||||
|
||||
@Override
|
||||
public String[] mapRow(final Sheet sheet, final String[] row, final int rowNum) throws Exception {
|
||||
return row;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ public class PoiSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int getNumberOfRows() {
|
||||
return this.delegate.getLastRowNum() + 1;
|
||||
}
|
||||
@@ -54,6 +55,7 @@ public class PoiSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.delegate.getSheetName();
|
||||
}
|
||||
@@ -61,6 +63,7 @@ public class PoiSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String[] getRow(final int rowNumber) {
|
||||
if (rowNumber > this.delegate.getLastRowNum()) {
|
||||
return null;
|
||||
@@ -94,6 +97,7 @@ public class PoiSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String[] getHeader() {
|
||||
return this.getRow(0);
|
||||
}
|
||||
@@ -101,6 +105,7 @@ public class PoiSheet implements Sheet {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int getNumberOfColumns() {
|
||||
final String[] columns = this.getHeader();
|
||||
if (columns != null) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class DefaultRowTokenizer implements RowTokenizer, InitializingBean {
|
||||
private boolean includeSheetName = false;
|
||||
private String attributeForSheetName = null;
|
||||
|
||||
@Override
|
||||
public FieldSet tokenize(final Sheet sheet, final String[] row) {
|
||||
String[] values = new String[sheet.getNumberOfColumns()];
|
||||
System.arraycopy(row, 0, values, 0, row.length);
|
||||
|
||||
@@ -31,6 +31,7 @@ public class MappingColumnToAttributeConverter implements ColumnToAttributeConve
|
||||
|
||||
private final Map<String, String> mapping = new HashMap<String, String>();
|
||||
|
||||
@Override
|
||||
public String toAttribute(final String column) {
|
||||
if (this.mapping.containsKey(column)) {
|
||||
return this.mapping.get(column);
|
||||
@@ -38,6 +39,7 @@ public class MappingColumnToAttributeConverter implements ColumnToAttributeConve
|
||||
return column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toColumn(final String attribute) {
|
||||
if (this.mapping.containsValue(attribute)) {
|
||||
for (Map.Entry<String, String> entry : this.mapping.entrySet()) {
|
||||
|
||||
@@ -23,10 +23,12 @@ package org.springframework.batch.item.excel.transform;
|
||||
*/
|
||||
public class PassThroughColumnToAttributeConverter implements ColumnToAttributeConverter {
|
||||
|
||||
@Override
|
||||
public String toAttribute(final String column) {
|
||||
return column;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toColumn(final String attribute) {
|
||||
return attribute;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user