package frame.file;
|
|
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 CellDataType[] getExportType() {
|
if (item != null) {
|
CellDataType[] result = item.getExportType();
|
|
if (result != null) {
|
return result;
|
}
|
}
|
|
CellDataType? cellType = CellTypes.toExcelCellType(fromType);
|
return new CellDataType[1] { cellType.Value };
|
}
|
}
|
}
|