InboundContext context = data.getContext();
Object converted = context.getConverted(data, paramType);
if (converted == null)
{
Converter converter = null;
// Was the inbound variable marshalled as an Object in the client
// (could mean that this is an instance of one of our generated
// JavaScript classes)
String type = data.getNamedObjectType();
if (type != null)
{
converter = getNamedConverter(type, paramType);
}
// Fall back to the standard way of locating a converter if we
// didn't find anything above
if (converter == null)
{
converter = getConverter(paramType);
}
if (converter == null)
{
log.error("Missing converter. Context of conversion: " + thc);
throw new ConversionException(paramType, "No inbound converter found for property '" + thc.getName() + "' of type '" + paramType.getName() + "'");
}
context.pushContext(thc);
converted = converter.convertInbound(paramType, data);
context.popContext();
}
return (T) converted;
}