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
77
78
79
80
81
82
83
84
85
package frame.file;
 
import org.apache.poi.ss.format.CellFormatType;
 
import com.alibaba.druid.sql.ast.statement.SQLCommentStatement.Type;
 
import frame.data.meta.EntityMeta;
 
public class IOMappingItemRuntime {
     private IOMappingItem item;
     private String fromField;
     private int fromIndex;
     private String fromType;
     private String toField;
     private int toIndex;
     private String toType;
     
     public IOMappingItemRuntime(IOMappingItem ioMappingItem, String fromField, EntityMeta fromFieldMeta, String toField,  EntityMeta toFieldMeta) {
         item = ioMappingItem;
         this.fromField = fromField == null ? null : fromField.toLowerCase();
 
         if (fromFieldMeta != null) {
             fromIndex = fromFieldMeta.getFieldCount();
             fromType = fromFieldMeta.getName();
         }
         else {
             fromIndex = -1;
             fromType = null;
         }
         
         //2. set to
         this.toField = toField == null ? null : toField.toLowerCase();
 
         if (toFieldMeta != null) {
             toIndex = toFieldMeta.getFieldCount();
             toType = toFieldMeta.getName();
         }
         else {
             toIndex = -1;
             toType = null;
         }
     }
     
     public CellFormatType[] getExportType() {
         if (item != null) {
             CellFormatType[] result = item.getExportType();
 
             if (result != null) {
                 return result;
             }
         }
 
         CellFormatType cellType = CellTypes.toExcelCellType(fromType);
         return new CellFormatType[1] { cellType.Value };
     }
     
     public IOMappingItem getItem() {
         return item;
     }
 
     public String getFromField() {
         return fromField;
     }
 
     public int getFromIndex() {
         return fromIndex;
     }
 
     public String getFromType() {
         return fromType;
     }
 
     public String getToField() {
         return toField;
     }
 
     public int getToIndex() {
         return toIndex;
     }
 
     public String getToType() {
         return toType;
     }
     
}