{
String valueClassName = Object.class.getName();
JRXmlLoader xmlLoader = (JRXmlLoader) digester.peek(digester.getCount() - 1);
JasperDesign design = (JasperDesign) digester.peek(digester.getCount() - 2);
JRDatasetRun datasetRun = (JRDatasetRun) digester.peek(1);
JRDesignDataset dataset = (JRDesignDataset) design.getDatasetMap().get(datasetRun.getDatasetName());
if (dataset == null)
{
xmlLoader.addError(new JRValidationException("Unknown sub dataset " + datasetRun.getDatasetName(), datasetRun));
}
else
{
JRDatasetParameter runParameter = (JRDatasetParameter) digester.peek();
JRParameter param = (JRParameter) dataset.getParametersMap().get(runParameter.getName());
if (param == null)
{
xmlLoader.addError(new JRValidationException("Unknown parameter " + runParameter.getName() + " in sub dataset " + datasetRun.getDatasetName(), runParameter));
}
else
{
valueClassName = param.getValueClassName();
}