JRParameter[] parameters = dataset.getParameters();
if (parameters != null && parameters.length > 0)
{
for(int index = 0; index < parameters.length; index++)
{
JRParameter parameter = parameters[index];
Object errorSource = parameter;
if (parameter.isSystemDefined())
{
errorSource = jasperDesign;
}
if (parameter.getName() == null || parameter.getName().trim().length() == 0)
{
addBrokenRule("Parameter name missing.", errorSource);
}
if (parameter.getValueClassName() == null)
{
addBrokenRule("Class not set for parameter : " + parameter.getName(), errorSource);
}
else
{
try
{
Class parameterType = parameter.getValueClass();
JRExpression expression = parameter.getDefaultValueExpression();
if (expression != null)
{
try
{
if (expression.getValueClass() == null)
{
addBrokenRule("No value class defined for the expression in parameter: " + parameter.getName(), expression);
}
else
{
if (!parameterType.isAssignableFrom(expression.getValueClass()))
{
addBrokenRule("The parameter default value expression class is not compatible with the parameter's class : " + parameter.getName(), expression);
}
}
}
catch (JRRuntimeException e)
{