com.gitee.beiding.template_excel.ValueExtractCell Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of template-excel Show documentation
Show all versions of template-excel Show documentation
使用模板快速提取excel文件中的数据为数据实体,或者使用模板将数据实体渲染成excel
package com.gitee.beiding.template_excel;
import java.util.Map;
class ValueExtractCell extends ExtractCell {
private Object object;
ValueExtractCell(Object object) {
this.object = object;
}
@Override
public Map extract(Object obj, Merge merge) {
if (obj == null) {
return null;
}
if (obj.equals(object)) {
if (merge == this.merge) {
return emptyMap;
} else {
if (this.merge.getCol() != merge.getCol()) {
return null;
}
if (this.merge.getRow() == 1) {
this.blankToken = merge.getRow() - 1;
return emptyMap;
}
}
}
return null;
}
}