else
{
// Check if the value type matches the parameter type;
// otherwise the application programmer obviously supplied the wrong type of data in the input parameters.
if (! type.getJavaClass().isAssignableFrom(value.getClass()))
throw new EngineException("IncorrectParameterType", "Cannot bind value of type "
+ value.getClass() + " to parameter '" + param.getQualifier() + "' (type "
+ type.getJavaClass() + ").");
}
}
}
catch (ValidationException e)
{
// Conversion failed, log the error
throw new EngineException("ParamterValidation", "Error binding value of type " + (value != null ? value.getClass() : "?")
+ " to parameter '" + param.getQualifier() + "' (type " + type.getJavaClass() + ").", e);
}
}
else
{
// Complex type; instantiate it if not present yet
if (value != null)
{
if (! type.getJavaClass().isAssignableFrom(value.getClass()))
throw new EngineException("IncorrectParameterType", "Cannot bind value of type " + value.getClass()
+ " to parameter '" + param.getQualifier() + "' (type " + type.getJavaClass() + ").");
}
}
// Assign the result to the parameter