{
Map parametersMap = dataset.getParametersMap();
for(int j = 0; j < chunks.length; j++)
{
JRQueryChunk queryChunk = chunks[j];
switch (queryChunk.getType())
{
case JRQueryChunk.TYPE_PARAMETER :
{
JRParameter parameter = (JRParameter)parametersMap.get(queryChunk.getText());
if ( parameter == null )
{
addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
}
else if (queryExecuterFactory != null)
{
String parameterType = null;
try
{
parameterType = parameter.getValueClassName();
}
catch (JRRuntimeException e)
{
// ignore, already added when the parameter got verified
}
if (parameterType != null && !queryExecuterFactory.supportsQueryParameterType(parameterType))
{
addBrokenRule("Parameter type not supported in query : " + queryChunk.getText() + " class " + parameterType, query);
}
}
break;
}
case JRQueryChunk.TYPE_PARAMETER_CLAUSE :
{
if (!parametersMap.containsKey(queryChunk.getText()))
{
addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
}
break;
}
case JRQueryChunk.TYPE_TEXT :
default :