// ignore the top level mapping for the Feature itself
// as it was already set
continue;
}
if (attMapping.isList()) {
Attribute instance = setAttributeValue(target, null, sources.get(0),
attMapping, null, null, selectedProperties.get(attMapping));
if (sources.size() > 1 && instance != null) {
List<Object> values = new ArrayList<Object>();
Expression sourceExpr = attMapping.getSourceExpression();
for (Feature source : sources) {
values.add(getValue(sourceExpr, source));
}
String valueString = StringUtils.join(values.iterator(), " ");
StepList fullPath = attMapping.getTargetXPath();
StepList leafPath = fullPath.subList(fullPath.size() - 1, fullPath.size());
if (instance instanceof ComplexAttributeImpl) {
// xpath builder will work out the leaf attribute to set values on
xpathAttributeBuilder.set(instance, leafPath, valueString, null, null,
false, sourceExpr);
} else {
// simple attributes
instance.setValue(valueString);
}
}
} else if (attMapping.isMultiValued()) {
// extract the values from multiple source features of the same id
// and set them to one built feature