public class DefaultStreamExcelBuilder<T> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected Configuration |
configuration |
protected Map<Integer,Integer> |
customWidthMap
自定义宽度
|
protected Map<Field,String> |
defaultValueMap
默认值集合
|
protected List<String> |
fieldDisplayOrder
字段展示顺序
|
protected List<FieldDefinition> |
filteredFields
已排序字段
|
protected boolean |
hasMultiColumn
是否拥有聚合列
|
protected boolean |
isMapBuild
是否为Map类型导出
|
protected StyleParser |
styleParser |
protected int |
titleLevel
标题层级
|
protected List<String> |
titles
标题
|
protected List<FieldDefinition> filteredFields
protected int titleLevel
protected boolean isMapBuild
protected Configuration configuration
protected StyleParser styleParser
protected boolean hasMultiColumn
public static <T> DefaultStreamExcelBuilder<T> of(Class<T> dataType)
T - TdataType - 数据的类类型public static <T> DefaultStreamExcelBuilder<T> of(Class<T> dataType, org.apache.poi.ss.usermodel.Workbook workbook)
T - TdataType - 数据的类类型workbook - workbookpublic static <T> DefaultStreamExcelBuilder<T> of(Class<T> dataType, Path excel)
T - TdataType - 数据的类类型excel - excelpublic static <T> DefaultStreamExcelBuilder<T> of(Class<T> dataType, InputStream excelInputStream)
T - TdataType - 数据的类类型excelInputStream - excelInputStreampublic DefaultStreamExcelBuilder<T> titles(List<String> titles)
public DefaultStreamExcelBuilder<T> sheetName(String sheetName)
public DefaultStreamExcelBuilder<T> fieldDisplayOrder(List<String> fieldDisplayOrder)
public DefaultStreamExcelBuilder<T> workbookType(WorkbookType workbookType)
public DefaultStreamExcelBuilder<T> noStyle()
public DefaultStreamExcelBuilder<T> widthStrategy(WidthStrategy widthStrategy)
@Deprecated public DefaultStreamExcelBuilder<T> autoWidthStrategy(AutoWidthStrategy autoWidthStrategy)
public DefaultStreamExcelBuilder<T> fixedTitles()
public DefaultStreamExcelBuilder<T> widths(int... widths)
public DefaultStreamExcelBuilder<T> width(int columnIndex, int width)
public DefaultStreamExcelBuilder<T> hideColumns(int... columnIndexs)
public DefaultStreamExcelBuilder<T> threadPool(ExecutorService executorService)
executorService - 线程池public DefaultStreamExcelBuilder<T> hasStyle()
public DefaultStreamExcelBuilder<T> capacity(int capacity)
capacity - 容量public DefaultStreamExcelBuilder<T> pathConsumer(Consumer<Path> pathConsumer)
pathConsumer - pathConsumerpublic DefaultStreamExcelBuilder<T> groups(Class<?>... groups)
groups - 分组public DefaultStreamExcelBuilder<T> waitQueueSize(int waitQueueSize)
public DefaultStreamExcelBuilder<T> style(String... styles)
public DefaultStreamExcelBuilder<T> templateHandler(Class<? extends TemplateHandler> templateHandlerClass)
public DefaultStreamExcelBuilder<T> onStartSheet(Consumer<org.apache.poi.ss.usermodel.Sheet> startSheetConsumer)
public DefaultStreamExcelBuilder<T> freezePane(FreezePane freezePane)
public DefaultStreamExcelBuilder<T> titleRowHeight(int titleRowHeight)
public DefaultStreamExcelBuilder<T> rowHeight(int rowHeight)
public DefaultStreamExcelBuilder<T> binding(Object... applicationBeans)
public DefaultStreamExcelBuilder<T> binding(Set<Object> applicationBeans)
public DefaultStreamExcelBuilder<T> autoMerge()
public DefaultStreamExcelBuilder<T> start()
public void append(T data)
data - 数据public <E> void append(String templateDir, String templateFileName, Map<String,E> renderData)
public void asyncAppend(ListSupplier<T> supplier)
public org.apache.poi.ss.usermodel.Workbook build()
public void close()
throws IOException
IOExceptionpublic void cancel()
public void clear()
protected List<FieldDefinition> getFilteredFields(ClassFieldContainer classFieldContainer, Class<?>... groups)
classFieldContainer - classFieldContainergroups - 分组protected void parseGlobalStyle()
protected Table createTable()
protected Tr createTr(List<Pair<? extends Class,?>> contents)
contents - 内容集合protected void setPrompt(Td td, int index)
protected List<FieldDefinition> getGroupFields(List<FieldDefinition> preElectionFields, Class<?>[] groups)
protected List<FieldDefinition> getPreElectionFields(ClassFieldContainer classFieldContainer)
protected <T> List<List<Pair<? extends Class,?>>> getMultiRenderContent(T data, List<FieldDefinition> sortedFields)
T - 泛型data - 数据集合sortedFields - 排序字段protected <T> LinkedList<Pair<? extends Class,?>> getOriginalRenderContent(T data, List<FieldDefinition> sortedFields)
T - 泛型data - 数据集合sortedFields - 排序字段Copyright © 2023. All rights reserved.