package foundation.data.mapping;
|
|
import foundation.data.meta.field.Field;
|
import foundation.translator.ValueType;
|
|
public class FieldMappingRuntime {
|
|
private FieldMapping item;
|
private Field fromField;
|
private Field toField;
|
private String fromName;
|
private String toName;
|
private int fromIndex;
|
private int toIndex;
|
|
|
public FieldMappingRuntime(FieldMapping ioMappingItem, Field fromField, Field toField, int fromIndex, int toIndex) {
|
item = ioMappingItem;
|
|
this.fromField = fromField;
|
this.toField = toField;
|
|
this.fromIndex = fromIndex;
|
this.toIndex = toIndex;
|
}
|
|
public FieldMappingRuntime(FieldMapping ioMappingItem, String fromName, Field toField, int fromIndex, int toIndex) {
|
item = ioMappingItem;
|
|
this.fromName = fromName;
|
this.toField = toField;
|
|
this.fromIndex = fromIndex;
|
this.toIndex = toIndex;
|
}
|
|
|
public FieldMappingRuntime(FieldMapping ioMappingItem, Field fromField, String toName, int fromIndex, int toIndex) {
|
item = ioMappingItem;
|
|
this.fromField = fromField;
|
this.toName = toName;
|
|
this.fromIndex = fromIndex;
|
this.toIndex = toIndex;
|
}
|
|
public FieldMappingRuntime(FieldMapping ioMappingItem, String fromName, String toName, int fromIndex, int toIndex) {
|
item = ioMappingItem;
|
|
this.fromName = fromName;
|
this.toName = toName;
|
|
this.fromIndex = fromIndex;
|
this.toIndex = toIndex;
|
}
|
|
public FieldMapping getFieldMapping() {
|
return item;
|
}
|
|
public String getFromName() {
|
if (fromField != null) {
|
return fromField.getName();
|
}
|
|
return fromName;
|
}
|
|
public ValueType getFromType() {
|
if (fromField != null) {
|
return fromField.getType();
|
}
|
|
return null;
|
}
|
|
public String getToName() {
|
if (toField != null) {
|
return toField.getName();
|
}
|
|
return toName;
|
}
|
|
public int getFromIndex() {
|
return fromIndex;
|
}
|
|
public int getToIndex() {
|
return toIndex;
|
}
|
|
public ValueType getToType() {
|
if (toField != null) {
|
return toField.getType();
|
}
|
|
return null;
|
}
|
|
public StructuredName getToStructuredName() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
}
|