Browse Source

工具类加入私有构造方法

bugfix
Jiaju Zhuang 5 years ago
parent
commit
1adb06af37
  1. 2
      quickstart.md
  2. 3
      src/main/java/com/alibaba/excel/metadata/BasicParameter.java
  3. 2
      src/main/java/com/alibaba/excel/util/BooleanUtils.java
  4. 2
      src/main/java/com/alibaba/excel/util/CollectionUtils.java
  5. 2
      src/main/java/com/alibaba/excel/util/FileUtils.java
  6. 2
      src/main/java/com/alibaba/excel/util/IoUtils.java
  7. 2
      src/main/java/com/alibaba/excel/util/PositionUtils.java
  8. 2
      src/main/java/com/alibaba/excel/util/StringUtils.java
  9. 2
      src/main/java/com/alibaba/excel/util/StyleUtil.java
  10. 2
      src/main/java/com/alibaba/excel/util/WorkBookUtil.java

2
quickstart.md

@ -1,5 +1,7 @@
# easyexcel核心功能 # easyexcel核心功能
## 目录 ## 目录
### 前言
读写的对象都用到了[Lombok](https://www.projectlombok.org/),他会自动生成`get`,`set` ,如果不需要自己创建对象并生成`get`,`set` 。
### 读 ### 读
DEMO代码地址:[https://github.com/alibaba/easyexcel/blob/master/src/test/java/com/alibaba/easyexcel/demo/read/ReadTest.java](/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java) DEMO代码地址:[https://github.com/alibaba/easyexcel/blob/master/src/test/java/com/alibaba/easyexcel/demo/read/ReadTest.java](/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java)
* [最简单的读](#simpleRead) * [最简单的读](#simpleRead)

3
src/main/java/com/alibaba/excel/metadata/BasicParameter.java

@ -1,6 +1,5 @@
package com.alibaba.excel.metadata; package com.alibaba.excel.metadata;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.alibaba.excel.converters.Converter; import com.alibaba.excel.converters.Converter;
@ -22,7 +21,7 @@ public class BasicParameter {
/** /**
* Custom type conversions override the default * Custom type conversions override the default
*/ */
private List<Converter> customConverterList = new ArrayList<Converter>(); private List<Converter> customConverterList;
/** /**
* Automatic trim includes sheet name and content * Automatic trim includes sheet name and content
*/ */

2
src/main/java/com/alibaba/excel/util/BooleanUtils.java

@ -10,6 +10,8 @@ public class BooleanUtils {
private static final String TRUE_NUMBER = "1"; private static final String TRUE_NUMBER = "1";
private static final String FALSE_NUMBER = "0"; private static final String FALSE_NUMBER = "0";
private BooleanUtils() {}
/** /**
* String to boolean * String to boolean
* *

2
src/main/java/com/alibaba/excel/util/CollectionUtils.java

@ -10,6 +10,8 @@ import java.util.Map;
*/ */
public class CollectionUtils { public class CollectionUtils {
private CollectionUtils() {}
public static boolean isEmpty(Collection<?> collection) { public static boolean isEmpty(Collection<?> collection) {
return (collection == null || collection.isEmpty()); return (collection == null || collection.isEmpty());
} }

2
src/main/java/com/alibaba/excel/util/FileUtils.java

@ -25,6 +25,8 @@ public class FileUtils {
private static final String CACHE = "excache"; private static final String CACHE = "excache";
private static final int WRITE_BUFF_SIZE = 8192; private static final int WRITE_BUFF_SIZE = 8192;
private FileUtils() {}
/** /**
* Reads the contents of a file into a byte array. * The file is always closed. * Reads the contents of a file into a byte array. * The file is always closed.
* *

2
src/main/java/com/alibaba/excel/util/IoUtils.java

@ -17,6 +17,8 @@ public class IoUtils {
*/ */
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
private IoUtils() {}
/** /**
* Gets the contents of an InputStream as a byte[]. * Gets the contents of an InputStream as a byte[].
* *

2
src/main/java/com/alibaba/excel/util/PositionUtils.java

@ -5,6 +5,8 @@ package com.alibaba.excel.util;
*/ */
public class PositionUtils { public class PositionUtils {
private PositionUtils() {}
public static int getRow(String currentCellIndex) { public static int getRow(String currentCellIndex) {
int row = 0; int row = 0;
if (currentCellIndex != null) { if (currentCellIndex != null) {

2
src/main/java/com/alibaba/excel/util/StringUtils.java

@ -7,6 +7,8 @@ package com.alibaba.excel.util;
*/ */
public class StringUtils { public class StringUtils {
private StringUtils() {}
public static boolean isEmpty(Object str) { public static boolean isEmpty(Object str) {
return (str == null || "".equals(str)); return (str == null || "".equals(str));
} }

2
src/main/java/com/alibaba/excel/util/StyleUtil.java

@ -17,6 +17,8 @@ import com.alibaba.excel.write.metadata.style.WriteFont;
*/ */
public class StyleUtil { public class StyleUtil {
private StyleUtil() {}
/** /**
* @param workbook * @param workbook
* @return * @return

2
src/main/java/com/alibaba/excel/util/WorkBookUtil.java

@ -22,6 +22,8 @@ import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
*/ */
public class WorkBookUtil { public class WorkBookUtil {
private WorkBookUtil() {}
public static Workbook createWorkBook(WriteWorkbookHolder writeWorkbookHolder) public static Workbook createWorkBook(WriteWorkbookHolder writeWorkbookHolder)
throws IOException, InvalidFormatException { throws IOException, InvalidFormatException {
if (ExcelTypeEnum.XLSX.equals(writeWorkbookHolder.getExcelType())) { if (ExcelTypeEnum.XLSX.equals(writeWorkbookHolder.getExcelType())) {

Loading…
Cancel
Save