diff --git a/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java b/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java index 06d94bb0..69211617 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java @@ -129,14 +129,6 @@ public class ExcelHeadProperty { Map customFiledMap = new TreeMap(); for (Field field : fieldList) { ExcelIgnore excelIgnore = field.getAnnotation(ExcelIgnore.class); - if(Modifier.isStatic(field.getModifiers())&&Modifier.isFinal(field.getModifiers())){ - ignoreMap.put(field.getName(),field); - continue; - } - if(Modifier.isTransient(field.getModifiers())){ - ignoreMap.put(field.getName(),field); - continue; - } if (excelIgnore != null) { ignoreMap.put(field.getName(), field); continue; diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java index 4c5d0c6b..44ce5cc7 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java @@ -13,8 +13,6 @@ import lombok.Data; **/ @Data public class ComplexHeadData { - private final static String TITLE = "title"; - private transient String trans = "transient"; @ExcelProperty({"主标题", "字符串标题"}) private String string; @ExcelProperty({"主标题", "日期标题"}) diff --git a/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java b/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java index 0da187f0..2582f105 100644 --- a/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java @@ -85,7 +85,7 @@ public class WriteTest { *

* 2. 使用{@link ExcelProperty}注解指定复杂的头 *

- * 3. 直接写即可,写入时会忽略static final和 transient + * 3. 直接写即可 */ @Test public void complexHeadWrite() {