Browse Source

Merge remote-tracking branch 'remotes/origin/master' into 2.1.0-beta1

pull/724/head
Jiaju Zhuang 5 years ago
parent
commit
5c89856804
  1. 4
      README.md
  2. 8
      src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java
  3. 2
      src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java
  4. 2
      src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java

4
README.md

@ -21,7 +21,7 @@ Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都
* [更新记事](/update.md)
## 维护者
姬朋飞(玉霄)
玉霄、庄家钜、怀宇
## 快速开始
### 读Excel
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)
@ -91,4 +91,4 @@ DEMO代码地址:[https://github.com/alibaba/easyexcel/blob/master/src/test/ja
### 联系我们
有问题阿里同事可以通过钉钉找到我,阿里外同学可以通过git留言。其他技术非技术相关的也欢迎一起探讨。
### 招聘&交流
阿里巴巴新零售事业部--诚招JAVA资深开发、技术专家。有意向可以微信联系,简历可以发我邮箱jipengfei.jpf@alibaba-inc.com
阿里巴巴新零售事业部--诚招JAVA资深开发、技术专家。有意向可以微信联系,简历可以发我邮箱jipengfei.jpf@alibaba-inc.com

8
src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java

@ -129,6 +129,14 @@ public class ExcelHeadProperty {
Map<Integer, Field> customFiledMap = new TreeMap<Integer, Field>();
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;

2
src/test/java/com/alibaba/easyexcel/test/demo/write/ComplexHeadData.java

@ -13,6 +13,8 @@ import lombok.Data;
**/
@Data
public class ComplexHeadData {
private final static String TITLE = "title";
private transient String trans = "transient";
@ExcelProperty({"主标题", "字符串标题"})
private String string;
@ExcelProperty({"主标题", "日期标题"})

2
src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java

@ -85,7 +85,7 @@ public class WriteTest {
* <p>
* 2. 使用{@link ExcelProperty}注解指定复杂的头
* <p>
* 3. 直接写即可
* 3. 直接写即可,写入时会忽略static final和 transient
*/
@Test
public void complexHeadWrite() {

Loading…
Cancel
Save