david-PC\david
2018-06-12 f240ac3ccd37c541cab2c21cfc433d3510999a3c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package frame.file;
 
import java.util.ArrayList;
import java.util.List;
 
import org.apache.poi.ss.format.CellFormatType;
 
import frame.data.Entity;
import frame.file.CellDataType;
import frame.file.CellTypes;
import frame.file.IFileload;
import frame.util.Util;
 
public class IOMappingItem implements IFileload{
    private String id;
    private String parentId;
    private String fromField;
    private String toField;
    private boolean updateIgnore;
    private boolean insertIgnore;
    private CellDataType[] exportType;
    
    @Override
    public void initLoad(Entity entity) {
        // TODO Auto-generated method stub
        
    }
    
    private CellDataType[] parseExportType(String exportType) {
        //TODO   parseExportType
        if (Util.isEmptyStr(exportType)) {
            return null;
        }
 
        String[] values = Utils.split(exportType);
        List<CellDataType> result = new ArrayList<CellDataType>();
 
        for (String value : values) {
            if (Util.isEmptyStr(value)) {
                continue;
            }
 
            CellDataType cellType = CellTypes.toExcelCellType(value);
 
            if (cellType != null) {
                result.add(cellType);
            }
        }
 
        return (CellDataType[]) result.toArray();
    }
 
    public String getId() {
        return id;
    }
    public String getParentId() {
        return parentId;
    }
    public String getFromField() {
        return fromField;
    }
    public String getToField() {
        return toField;
    }
    public boolean isInsertIgnore() {
        return insertIgnore;
    }
    public boolean isUpdateIgnore() {
        return updateIgnore;
    }
    
    public CellDataType[] getExportType() {
        return exportType;
    }
    
}