public final class ListenerChain extends Object
| 构造器和说明 |
|---|
ListenerChain() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addReadListener(Map<Class<? extends ExcelReadListener>,List<ExcelReadListener>> readListenersCache,
ExcelReadListener readListener)
Add a read listener
|
static void |
addWriteListener(Map<Class<? extends ExcelWriteListener>,List<ExcelWriteListener>> writeListenerCache,
ExcelWriteListener listener,
org.apache.poi.ss.usermodel.Workbook workbook)
Add a write listener
|
static void |
doCompleteCell(Map<Class<? extends ExcelWriteListener>,List<ExcelWriteListener>> excelListeners,
org.apache.poi.ss.usermodel.Sheet sheet,
org.apache.poi.ss.usermodel.Row row,
org.apache.poi.ss.usermodel.Cell cell,
ExcelField excelField,
Field field,
String headName,
int index,
int colIndex,
boolean isHead,
Object value)
Execute write cell listener
|
static void |
doCompleteRow(Map<Class<? extends ExcelWriteListener>,List<ExcelWriteListener>> excelListeners,
org.apache.poi.ss.usermodel.Sheet sheet,
org.apache.poi.ss.usermodel.Row row,
int index,
boolean isHead)
Execute write row listener
|
static void |
doCompleteSheet(ExcelWriterContext context)
Execute write sheet listener
|
static <R> void |
doReadCell(List<ExcelReadListener> rowReadListeners,
R r,
Object cellValue,
Field field,
int rowIndex,
int colIndex,
boolean isHead)
Execute read row listener
|
static <R> boolean |
doReadEmpty(List<ExcelReadListener> emptyReadListeners,
R r,
Field field,
ExcelField excelField,
int rowIndex,
int colIndex,
boolean hasNext)
Execute read empty listener
|
static <R> boolean |
doReadRow(List<ExcelReadListener> rowReadListeners,
R r,
List<String> headNames,
int rowIndex,
boolean isHead,
boolean hasNext)
Execute read row listener
|
static <R> void |
doResultNotify(ExcelResultReadListener<R> resultReadListener,
List<R> data)
Execute result notify listener
|
static void |
doWorkbookFlushBefore(ExcelWriterContext context)
Execute write workbook listener
|
public static void doCompleteCell(Map<Class<? extends ExcelWriteListener>,List<ExcelWriteListener>> excelListeners, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Row row, org.apache.poi.ss.usermodel.Cell cell, ExcelField excelField, Field field, String headName, int index, int colIndex, boolean isHead, Object value)
excelListeners - excelListenerssheet - Current sheetrow - Current rowcell - Current cellindex - Line index, index type according to isHead, Starting from 0colIndex - Current cell indexisHead - Whether is excel headexcelField - ExcelField annotation of current fieldfield - Current fieldvalue - Cell valueheadName - The header name of the list where the cell residespublic static void doCompleteRow(Map<Class<? extends ExcelWriteListener>,List<ExcelWriteListener>> excelListeners, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Row row, int index, boolean isHead)
excelListeners - excelListenerssheet - Current sheetrow - Create the finished rowindex - Line index, index type according to isHead,Starting from 0isHead - Whether is excel headpublic static void doCompleteSheet(ExcelWriterContext context)
context - Excel write contextpublic static void doWorkbookFlushBefore(ExcelWriterContext context)
context - Excel write contextpublic static <R> boolean doReadRow(List<ExcelReadListener> rowReadListeners, R r, List<String> headNames, int rowIndex, boolean isHead, boolean hasNext)
R - RrowReadListeners - rowReadListenersr - Generated Java objectrowIndex - The index of the current rowisHead - Whether is excel headhasNext - Whether has next rowheadNames - All the table headers of the current rowpublic static <R> void doReadCell(List<ExcelReadListener> rowReadListeners, R r, Object cellValue, Field field, int rowIndex, int colIndex, boolean isHead)
R - RrowReadListeners - rowReadListenersr - Current Java objectcellValue - Current cell valuefield - Current fieldrowIndex - Current row indexcolIndex - Current col indexisHead - Whether is excel headerpublic static <R> boolean doReadEmpty(List<ExcelReadListener> emptyReadListeners, R r, Field field, ExcelField excelField, int rowIndex, int colIndex, boolean hasNext)
R - RemptyReadListeners - emptyReadListenersr - Current Java objectfield - Current fieldexcelField - ExcelField annotation on that fieldrowIndex - The index of the current rowcolIndex - The index of the current colhasNext - Whether has next rowpublic static <R> void doResultNotify(ExcelResultReadListener<R> resultReadListener, List<R> data)
R - RresultReadListener - resultReadListenerdata - Import all the Java objects generated after successpublic static void addWriteListener(Map<Class<? extends ExcelWriteListener>,List<ExcelWriteListener>> writeListenerCache, ExcelWriteListener listener, org.apache.poi.ss.usermodel.Workbook workbook)
writeListenerCache - writeListenerCachelistener - Write listenerworkbook - workbookpublic static void addReadListener(Map<Class<? extends ExcelReadListener>,List<ExcelReadListener>> readListenersCache, ExcelReadListener readListener)
readListenersCache - readListenersCachereadListener - read ListenerCopyright © 2020. All rights reserved.