mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix comment
This commit is contained in:
@@ -24,10 +24,7 @@ import cn.hutool.v7.core.lang.Assert;
|
||||
import cn.hutool.v7.core.util.CharsetUtil;
|
||||
import cn.hutool.v7.core.util.ObjUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringReader;
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
@@ -42,13 +39,16 @@ import java.util.Objects;
|
||||
* @since 5.0.4
|
||||
*/
|
||||
public class CsvBaseReader implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 默认编码
|
||||
*/
|
||||
protected static final Charset DEFAULT_CHARSET = CharsetUtil.UTF_8;
|
||||
|
||||
/**
|
||||
* 读取配置
|
||||
*/
|
||||
private final CsvReadConfig config;
|
||||
|
||||
//--------------------------------------------------------------------------------------------- Constructor start
|
||||
|
@@ -18,6 +18,7 @@ package cn.hutool.v7.poi.csv;
|
||||
|
||||
import cn.hutool.v7.core.collection.ListUtil;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -28,9 +29,16 @@ import java.util.List;
|
||||
* @author Looly
|
||||
*/
|
||||
public class CsvData implements Iterable<CsvRow>, Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 头信息
|
||||
*/
|
||||
private final List<String> header;
|
||||
/**
|
||||
* 行数据
|
||||
*/
|
||||
private final List<CsvRow> rows;
|
||||
|
||||
/**
|
||||
|
@@ -24,10 +24,7 @@ import cn.hutool.v7.core.text.StrTrimer;
|
||||
import cn.hutool.v7.core.text.StrUtil;
|
||||
import cn.hutool.v7.core.util.ObjUtil;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -36,11 +33,18 @@ import java.util.*;
|
||||
* @author Looly
|
||||
*/
|
||||
public final class CsvParser extends ComputeIter<CsvRow> implements Closeable, Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final int DEFAULT_ROW_CAPACITY = 10;
|
||||
|
||||
/**
|
||||
* 读取配置
|
||||
*/
|
||||
private final CsvReadConfig config;
|
||||
/**
|
||||
* Tokener
|
||||
*/
|
||||
private final CsvTokener tokener;
|
||||
/**
|
||||
* 前一个特殊分界字符
|
||||
|
@@ -25,6 +25,7 @@ import cn.hutool.v7.core.io.file.PathUtil;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.Reader;
|
||||
import java.io.Serial;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Iterator;
|
||||
@@ -38,8 +39,12 @@ import java.util.stream.StreamSupport;
|
||||
* @since 4.0.1
|
||||
*/
|
||||
public class CsvReader extends CsvBaseReader implements Iterable<CsvRow>, Closeable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* {@link Reader}
|
||||
*/
|
||||
private final Reader reader;
|
||||
|
||||
//--------------------------------------------------------------------------------------------- Constructor start
|
||||
|
@@ -19,6 +19,7 @@ package cn.hutool.v7.poi.excel;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import cn.hutool.v7.core.collection.CollUtil;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -32,6 +33,7 @@ import java.util.List;
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public class RowGroup implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
@@ -44,8 +46,17 @@ public class RowGroup implements Serializable {
|
||||
return new RowGroup(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 样式
|
||||
*/
|
||||
private CellStyle style;
|
||||
/**
|
||||
* 子分组
|
||||
*/
|
||||
private List<RowGroup> children;
|
||||
|
||||
/**
|
||||
|
@@ -45,44 +45,78 @@ public class SheetDataSaxHandler extends DefaultHandler {
|
||||
* 行处理器
|
||||
*/
|
||||
protected RowHandler rowHandler;
|
||||
// 配置项:是否对齐数据,即在行尾补充null cell
|
||||
/**
|
||||
*/
|
||||
private final boolean padCellAtEndOfRow;
|
||||
|
||||
// 单元格的格式表,对应style.xml
|
||||
/**
|
||||
* 单元格的格式表,对应style.xml
|
||||
*/
|
||||
protected StylesTable stylesTable;
|
||||
// excel 2007 的共享字符串表,对应sharedString.xml
|
||||
/**
|
||||
* excel 2007 的共享字符串表,对应sharedString.xml
|
||||
*/
|
||||
protected SharedStrings sharedStrings;
|
||||
// sheet的索引,从0开始
|
||||
/**
|
||||
* sheet索引,从0开始
|
||||
*/
|
||||
protected int sheetIndex;
|
||||
|
||||
// 当前非空行
|
||||
/**
|
||||
* 当前非空行索引,从0开始
|
||||
*/
|
||||
protected int index;
|
||||
// 当前列
|
||||
/**
|
||||
* 当前列坐标
|
||||
*/
|
||||
private int curCell;
|
||||
// 单元数据类型
|
||||
/**
|
||||
* 单元格数据类型
|
||||
*/
|
||||
private CellDataType cellDataType;
|
||||
// 当前行号,从0开始
|
||||
/**
|
||||
* 当前行号,从0开始
|
||||
*/
|
||||
private long rowNumber;
|
||||
// 当前列坐标, 如A1,B5
|
||||
/**
|
||||
* 当前列坐标, 如A1,B5
|
||||
*/
|
||||
private String curCoordinate;
|
||||
// 当前节点名称
|
||||
/**
|
||||
* 当前节点名称
|
||||
*/
|
||||
private ElementName curElementName;
|
||||
// 前一个列的坐标
|
||||
/**
|
||||
* 前一个列的坐标
|
||||
*/
|
||||
private String preCoordinate;
|
||||
// 行的最大列坐标
|
||||
/**
|
||||
* 行的最大列坐标
|
||||
*/
|
||||
private String maxCellCoordinate;
|
||||
// 单元格样式
|
||||
/**
|
||||
* 单元格样式
|
||||
*/
|
||||
private XSSFCellStyle xssfCellStyle;
|
||||
// 单元格存储的格式化字符串,nmtFmt的formatCode属性的值
|
||||
/**
|
||||
* 单元格存储的格式化字符串,nmtFmt的formatCode属性的值
|
||||
*/
|
||||
private String numFmtString;
|
||||
// 是否处于sheetData标签内,sax只解析此标签内的内容,其它标签忽略
|
||||
/**
|
||||
* 是否处于sheetData标签内,sax只解析此标签内的内容,其它标签忽略
|
||||
*/
|
||||
private boolean isInSheetData;
|
||||
|
||||
// 上一次的内容
|
||||
/**
|
||||
* 上一次的内容
|
||||
*/
|
||||
private final StringBuilder lastContent = new StringBuilder();
|
||||
// 上一次的内容
|
||||
/**
|
||||
* 上一次的公式
|
||||
*/
|
||||
private final StringBuilder lastFormula = new StringBuilder();
|
||||
// 存储每行的列元素
|
||||
/**
|
||||
* 存储每行的列元素
|
||||
*/
|
||||
private List<Object> rowCellList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
|
@@ -16,11 +16,12 @@
|
||||
|
||||
package cn.hutool.v7.poi.excel.style;
|
||||
|
||||
import cn.hutool.v7.core.util.ObjUtil;
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import cn.hutool.v7.core.util.ObjUtil;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -30,6 +31,7 @@ import java.io.Serializable;
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public class CellBorderStyle implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
@@ -69,15 +71,47 @@ public class CellBorderStyle implements Serializable {
|
||||
.setLeftColor(colorIndex.getIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
* 顶部边框样式定义,如细线、粗线、虚线等
|
||||
*/
|
||||
private BorderStyle topStyle;
|
||||
|
||||
/**
|
||||
* 顶部边框颜色索引值,用于指定颜色主题或调色板中的颜色
|
||||
*/
|
||||
private Short topColor;
|
||||
|
||||
/**
|
||||
* 右侧边框样式定义,如细线、粗线、虚线等
|
||||
*/
|
||||
private BorderStyle rightStyle;
|
||||
|
||||
/**
|
||||
* 右侧边框颜色索引值,用于指定颜色主题或调色板中的颜色
|
||||
*/
|
||||
private Short rightColor;
|
||||
|
||||
/**
|
||||
* 底部边框样式定义,如细线、粗线、虚线等
|
||||
*/
|
||||
private BorderStyle bottomStyle;
|
||||
|
||||
/**
|
||||
* 底部边框颜色索引值,用于指定颜色主题或调色板中的颜色
|
||||
*/
|
||||
private Short bottomColor;
|
||||
|
||||
/**
|
||||
* 左侧边框样式定义,如细线、粗线、虚线等
|
||||
*/
|
||||
private BorderStyle leftStyle;
|
||||
|
||||
/**
|
||||
* 左侧边框颜色索引值,用于指定颜色主题或调色板中的颜色
|
||||
*/
|
||||
private Short leftColor;
|
||||
|
||||
|
||||
/**
|
||||
* 获取上边框的样式。
|
||||
*
|
||||
|
@@ -27,11 +27,7 @@ import org.ofdrw.layout.element.Img;
|
||||
import org.ofdrw.layout.element.Paragraph;
|
||||
import org.ofdrw.reader.OFDReader;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.io.*;
|
||||
import java.nio.file.Path;
|
||||
|
||||
/**
|
||||
@@ -41,8 +37,12 @@ import java.nio.file.Path;
|
||||
* @since 5.5.3
|
||||
*/
|
||||
public class OfdWriter implements Serializable, Closeable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* OFD文档
|
||||
*/
|
||||
private final OFDDoc doc;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user