mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix comment
This commit is contained in:
@@ -16,6 +16,7 @@ public class ExcelExtractorUtil {
|
|||||||
/**
|
/**
|
||||||
* 获取 {@link ExcelExtractor} 对象
|
* 获取 {@link ExcelExtractor} 对象
|
||||||
*
|
*
|
||||||
|
* @param wb {@link Workbook}
|
||||||
* @return {@link ExcelExtractor}
|
* @return {@link ExcelExtractor}
|
||||||
*/
|
*/
|
||||||
public static ExcelExtractor getExtractor(Workbook wb) {
|
public static ExcelExtractor getExtractor(Workbook wb) {
|
||||||
@@ -32,7 +33,7 @@ public class ExcelExtractorUtil {
|
|||||||
* 读取为文本格式<br>
|
* 读取为文本格式<br>
|
||||||
* 使用{@link ExcelExtractor} 提取Excel内容
|
* 使用{@link ExcelExtractor} 提取Excel内容
|
||||||
*
|
*
|
||||||
* @param wb {@link Workbook}
|
* @param wb {@link Workbook}
|
||||||
* @param withSheetName 是否附带sheet名
|
* @param withSheetName 是否附带sheet名
|
||||||
* @return Excel文本
|
* @return Excel文本
|
||||||
* @since 4.1.0
|
* @since 4.1.0
|
||||||
|
@@ -130,9 +130,9 @@ public abstract class AbstractSheetReader<T> implements SheetReader<T> {
|
|||||||
/**
|
/**
|
||||||
* 读取某一行数据
|
* 读取某一行数据
|
||||||
*
|
*
|
||||||
|
* @param sheet {@link Sheet}
|
||||||
* @param rowIndex 行号,从0开始
|
* @param rowIndex 行号,从0开始
|
||||||
* @return 一行数据
|
* @return 一行数据
|
||||||
* @since 4.0.3
|
|
||||||
*/
|
*/
|
||||||
protected List<Object> readRow(Sheet sheet, int rowIndex) {
|
protected List<Object> readRow(Sheet sheet, int rowIndex) {
|
||||||
return RowUtil.readRow(sheet.getRow(rowIndex), this.cellEditor);
|
return RowUtil.readRow(sheet.getRow(rowIndex), this.cellEditor);
|
||||||
|
@@ -15,13 +15,15 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ListSheetReader extends AbstractSheetReader<List<List<Object>>> {
|
public class ListSheetReader extends AbstractSheetReader<List<List<Object>>> {
|
||||||
|
|
||||||
|
/** 是否首行作为标题行转换别名 */
|
||||||
private final boolean aliasFirstLine;
|
private final boolean aliasFirstLine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造
|
* 构造
|
||||||
*
|
*
|
||||||
* @param startRowIndex 起始行(包含,从0开始计数)
|
* @param startRowIndex 起始行(包含,从0开始计数)
|
||||||
* @param endRowIndex 结束行(包含,从0开始计数)
|
* @param endRowIndex 结束行(包含,从0开始计数)
|
||||||
|
* @param aliasFirstLine 是否首行作为标题行转换别名
|
||||||
*/
|
*/
|
||||||
public ListSheetReader(int startRowIndex, int endRowIndex, boolean aliasFirstLine) {
|
public ListSheetReader(int startRowIndex, int endRowIndex, boolean aliasFirstLine) {
|
||||||
super(startRowIndex, endRowIndex);
|
super(startRowIndex, endRowIndex);
|
||||||
|
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
* @author looly
|
* @author looly
|
||||||
* @since 5.4.4
|
* @since 5.4.4
|
||||||
*/
|
*/
|
||||||
public abstract class BeanRowHandler<T> extends AbstractRowHandler<T>{
|
public abstract class BeanRowHandler<T> extends AbstractRowHandler<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标题所在行(从0开始计数)
|
* 标题所在行(从0开始计数)
|
||||||
@@ -30,14 +30,15 @@ public abstract class BeanRowHandler<T> extends AbstractRowHandler<T>{
|
|||||||
* 构造
|
* 构造
|
||||||
*
|
*
|
||||||
* @param headerRowIndex 标题所在行(从0开始计数)
|
* @param headerRowIndex 标题所在行(从0开始计数)
|
||||||
* @param startRowIndex 读取起始行(包含,从0开始计数)
|
* @param startRowIndex 读取起始行(包含,从0开始计数)
|
||||||
* @param endRowIndex 读取结束行(包含,从0开始计数)
|
* @param endRowIndex 读取结束行(包含,从0开始计数)
|
||||||
|
* @param clazz Bean类型
|
||||||
*/
|
*/
|
||||||
public BeanRowHandler(int headerRowIndex, int startRowIndex, int endRowIndex, Class<T> clazz){
|
public BeanRowHandler(int headerRowIndex, int startRowIndex, int endRowIndex, Class<T> clazz) {
|
||||||
super(startRowIndex, endRowIndex);
|
super(startRowIndex, endRowIndex);
|
||||||
Assert.isTrue(headerRowIndex <= startRowIndex, "Header row must before the start row!");
|
Assert.isTrue(headerRowIndex <= startRowIndex, "Header row must before the start row!");
|
||||||
this.headerRowIndex = headerRowIndex;
|
this.headerRowIndex = headerRowIndex;
|
||||||
this.convertFunc = (rowList)-> BeanUtil.toBean(IterUtil.toMap(headerList, rowList), clazz);
|
this.convertFunc = (rowList) -> BeanUtil.toBean(IterUtil.toMap(headerList, rowList), clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user