public class CsvBuilder<T> extends Object implements Closeable
| 限定符和类型 | 字段和说明 |
|---|---|
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
标题
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
append(List<T> beans) |
protected List<Pair<? extends Class,?>> |
assemblingMapContents(Map<String,Object> data) |
Csv |
build() |
Csv |
build(List<T> beans) |
void |
clear() |
void |
close() |
protected Table |
createTable()
创建table
|
protected List<Tr> |
createThead()
创建标题行
|
protected Tr |
createTr(List<Pair<? extends Class,?>> contents)
创建内容行
|
CsvBuilder<T> |
fieldDisplayOrder(List<String> fieldDisplayOrder) |
protected List<FieldDefinition> |
getFilteredFields(ClassFieldContainer classFieldContainer,
Class<?>... groups)
Core methods for obtaining export related fields, styles, etc
|
protected List<FieldDefinition> |
getGroupFields(List<FieldDefinition> preElectionFields,
Class<?>[] groups) |
protected <T> List<List<Pair<? extends Class,?>>> |
getMultiRenderContent(T data,
List<FieldDefinition> sortedFields)
获取需要被渲染的内容
|
protected <T> LinkedList<Pair<? extends Class,?>> |
getOriginalRenderContent(T data,
List<FieldDefinition> sortedFields)
获取需要被渲染的内容
|
protected List<FieldDefinition> |
getPreElectionFields(ClassFieldContainer classFieldContainer) |
CsvBuilder<T> |
groups(Class<?>... groups) |
CsvBuilder<T> |
noTitles() |
static <T> CsvBuilder<T> |
of(Class<T> clazz) |
protected void |
parseGlobalStyle() |
protected void |
setPrompt(Td td,
int index) |
protected void |
setTitles(List<String> titles) |
CsvBuilder<T> |
titles(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> CsvBuilder<T> of(Class<T> clazz)
public CsvBuilder<T> groups(Class<?>... groups)
public CsvBuilder<T> fieldDisplayOrder(List<String> fieldDisplayOrder)
public CsvBuilder<T> titles(List<String> titles)
public CsvBuilder<T> noTitles()
public Csv build()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic 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.