targetWrapperHandler = getWapperHandler(targetType.getLogical().get(0).getDataBinding(), true);
}
if ((!sourceWrapped) && targetWrapped) {
// Unwrapped --> Wrapped
WrapperInfo wrapper = targetOp.getWrapper();
ElementInfo wrapperElement = wrapper.getInputWrapperElement();
// If the source can be wrapped, wrapped it first
if (sourceWrapperHandler != null) {
Object sourceWrapper = sourceWrapperHandler.create(wrapperElement, context);
for (int i = 0; i < source.length; i++) {
ElementInfo argElement = wrapper.getInputChildElements().get(i);
sourceWrapperHandler.setChild(sourceWrapper, i, argElement, source[0]);
}
}
Object targetWrapper = targetWrapperHandler.create(wrapperElement, context);
if (source == null) {
return new Object[] {targetWrapper};
}
List<DataType<QName>> argTypes = wrapper.getUnwrappedInputType().getLogical();
for (int i = 0; i < source.length; i++) {
ElementInfo argElement = wrapper.getInputChildElements().get(i);
DataType<QName> argType = argTypes.get(i);
Object child = source[i];
child =
mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context
.getMetadata());