nl.bstoi.poiparser.core.strategy.annotation
Class AnnotatedPoiFileParser<T>

java.lang.Object
  extended by nl.bstoi.poiparser.core.strategy.AbstractPoiFileParser<T>
      extended by nl.bstoi.poiparser.core.strategy.annotation.AnnotatedPoiFileParser<T>

public class AnnotatedPoiFileParser<T>
extends AbstractPoiFileParser<T>


Constructor Summary
AnnotatedPoiFileParser()
          Default constructor
AnnotatedPoiFileParser(Map<String,Integer> columnFieldNameMapping)
          Use a different column field mapping and ignore the @Cell values in class.
AnnotatedPoiFileParser(Map<String,Integer> columnFieldNameMapping, Set<Integer> requiredColumnNumbers)
          Use a different column field mapping and ignore the @Cell values in class.
 
Method Summary
protected  void parseExcelMappingForClass(Class clazz)
          Recursive read of super classes that have excel parser information
 List<T> readExcelFile(File excelFile, String sheetName, Class<T> clazz)
           
 List<T> readExcelFile(File excelFile, String sheetName, Class<T> clazz, int startRow)
          Read a excel file from start row to last row.
 List<T> readExcelFile(File excelFile, String sheetName, Class<T> clazz, int startRow, int endRow)
          Read a excel file from start row to end row
 List<T> readExcelFile(InputStream inputStream, String sheetName, Class<T> clazz)
           
 List<T> readExcelFile(InputStream inputStream, String sheetName, Class<T> clazz, int startRow)
          Read a excel file input stream from given start row until last row
 List<T> readExcelFile(InputStream inputStream, String sheetName, Class<T> clazz, int startRow, int endRow)
          Read a excel file inputstream start row to end row
 void writeExcelFile(OutputStream outputStream, LinkedHashMap<String,List<T>> excelDataMap, Class<T> clazz)
           
 
Methods inherited from class nl.bstoi.poiparser.core.strategy.AbstractPoiFileParser
addColumnFieldNameMapping, addReadIgnoreColumn, addRequiredField, addWriteIgnoreColumn, getColumnFieldNameMapping, getDefaultConverterFactory, getHeaderFieldNameTranslationMapping, getReadIgnoreColumns, getWriteIgnoreColumns, ignoreRow, isEmptyRow, isEmptyValue, isIgnoreEmptyRows, isIgnoreFirstRow, isRemoveWriteIgnoreColumns, readField, readRow, readSheet, readSheet, readSheet, remapColumnFieldMapForWriting, setHeaderFieldNameTranslationMapping, setIgnoreEmptyRows, setIgnoreFirstRow, setRemoveWriteIgnoreColumns, validateColumnFieldMapForWriting, writeCell, writeHeaderRow, writeRow, writeSheet, writeWorkbook
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedPoiFileParser

public AnnotatedPoiFileParser()
Default constructor


AnnotatedPoiFileParser

public AnnotatedPoiFileParser(Map<String,Integer> columnFieldNameMapping)
Use a different column field mapping and ignore the @Cell values in class.

Parameters:
columnFieldNameMapping -

AnnotatedPoiFileParser

public AnnotatedPoiFileParser(Map<String,Integer> columnFieldNameMapping,
                              Set<Integer> requiredColumnNumbers)
Use a different column field mapping and ignore the @Cell values in class.

Parameters:
columnFieldNameMapping -
Method Detail

readExcelFile

public List<T> readExcelFile(File excelFile,
                             String sheetName,
                             Class<T> clazz)
                      throws IOException,
                             FileNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             RequiredFieldPoiParserException,
                             ReadPoiParserException
Specified by:
readExcelFile in class AbstractPoiFileParser<T>
Throws:
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
RequiredFieldPoiParserException
ReadPoiParserException

readExcelFile

public List<T> readExcelFile(File excelFile,
                             String sheetName,
                             Class<T> clazz,
                             int startRow,
                             int endRow)
                      throws IOException,
                             FileNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             RequiredFieldPoiParserException,
                             ReadPoiParserException
Description copied from class: AbstractPoiFileParser
Read a excel file from start row to end row

Specified by:
readExcelFile in class AbstractPoiFileParser<T>
Returns:
Throws:
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
RequiredFieldPoiParserException
ReadPoiParserException

readExcelFile

public List<T> readExcelFile(File excelFile,
                             String sheetName,
                             Class<T> clazz,
                             int startRow)
                      throws IOException,
                             FileNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             RequiredFieldPoiParserException,
                             ReadPoiParserException
Description copied from class: AbstractPoiFileParser
Read a excel file from start row to last row.

Specified by:
readExcelFile in class AbstractPoiFileParser<T>
Returns:
Throws:
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
RequiredFieldPoiParserException
ReadPoiParserException

readExcelFile

public List<T> readExcelFile(InputStream inputStream,
                             String sheetName,
                             Class<T> clazz)
                      throws IOException,
                             FileNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             RequiredFieldPoiParserException,
                             ReadPoiParserException
Specified by:
readExcelFile in class AbstractPoiFileParser<T>
Throws:
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
RequiredFieldPoiParserException
ReadPoiParserException

readExcelFile

public List<T> readExcelFile(InputStream inputStream,
                             String sheetName,
                             Class<T> clazz,
                             int startRow,
                             int endRow)
                      throws IOException,
                             FileNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             RequiredFieldPoiParserException,
                             ReadPoiParserException
Description copied from class: AbstractPoiFileParser
Read a excel file inputstream start row to end row

Specified by:
readExcelFile in class AbstractPoiFileParser<T>
Returns:
Throws:
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
RequiredFieldPoiParserException
ReadPoiParserException

readExcelFile

public List<T> readExcelFile(InputStream inputStream,
                             String sheetName,
                             Class<T> clazz,
                             int startRow)
                      throws IOException,
                             FileNotFoundException,
                             InstantiationException,
                             IllegalAccessException,
                             RequiredFieldPoiParserException,
                             ReadPoiParserException
Description copied from class: AbstractPoiFileParser
Read a excel file input stream from given start row until last row

Specified by:
readExcelFile in class AbstractPoiFileParser<T>
Returns:
Throws:
IOException
FileNotFoundException
InstantiationException
IllegalAccessException
RequiredFieldPoiParserException
ReadPoiParserException

writeExcelFile

public void writeExcelFile(OutputStream outputStream,
                           LinkedHashMap<String,List<T>> excelDataMap,
                           Class<T> clazz)
                    throws IOException,
                           InitialWritePoiParserException,
                           WritePoiParserException
Specified by:
writeExcelFile in class AbstractPoiFileParser<T>
Throws:
IOException
InitialWritePoiParserException
WritePoiParserException

parseExcelMappingForClass

protected void parseExcelMappingForClass(Class clazz)
Recursive read of super classes that have excel parser information

Parameters:
clazz -
excelMapping -


Copyright © 2011 BSTOI.NL. All Rights Reserved.