use of com.revolsys.gis.converter.SimpleRecordConveter in project com.revolsys.open by revolsys.
the class RecordConverterProcess method preRun.
@Override
protected void preRun(final Channel<Record> in, final Channel<Record> out) {
this.labelCountMap.connect();
// ignoredStatistics.connect();
if (this.simpleMapping != null) {
for (final Entry<Object, Map<String, Object>> entry : this.simpleMapping.entrySet()) {
final Object key = entry.getKey();
String sourceTypeName;
if (key instanceof String) {
sourceTypeName = (String) key;
} else {
sourceTypeName = String.valueOf(key.toString());
}
final Map<String, Object> map = entry.getValue();
final Object targetName = map.get("typePath");
String targetTypeName;
if (key instanceof String) {
targetTypeName = (String) targetName;
} else {
targetTypeName = String.valueOf(targetName.toString());
}
@SuppressWarnings("unchecked") final Map<String, String> attributeMapping = (Map<String, String>) map.get("attributeMapping");
final RecordDefinition targetRecordDefinition = getTargetRecordDefinition(targetTypeName);
final SimpleRecordConveter converter = new SimpleRecordConveter(targetRecordDefinition);
converter.addProcessor(new CopyValues(attributeMapping));
addTypeConverter(sourceTypeName, converter);
}
}
}
Aggregations