if (!data.getClass().isArray())
{
throw new ConversionException(data.getClass());
}
ArrayOutboundVariable ov = new ArrayOutboundVariable(outctx);
outctx.put(data, ov);
// Convert all the data members
int size = Array.getLength(data);
List<OutboundVariable> ovs = new ArrayList<OutboundVariable>();
for (int i = 0; i < size; i++)
{
OutboundVariable nested;
try
{
nested = converterManager.convertOutbound(Array.get(data, i), outctx);
}
catch (Exception ex)
{
String errorMessage = "Conversion error for " + data.getClass().getName() + ".";
log.warn(errorMessage, ex);
nested = new ErrorOutboundVariable(errorMessage);
}
ovs.add(nested);
}
// Group the list of converted objects into this OutboundVariable
ov.setChildren(ovs);
return ov;
}