throws SAXException
{
final RootXmlReadHandler rootHandler = getRootHandler();
final Object maybeReport = rootHandler.getHelperObject
(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
final SubReport report;
if (maybeReport instanceof SubReport == false)
{
// replace it ..
report = new SubReport();
report.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
}
else
{
report = (SubReport) maybeReport;
}
if (ReportParserUtil.isIncluded(rootHandler) == false)
{
final String query = attrs.getValue(getUri(), "query");
if (query != null)
{
report.setQuery(query);
}
}
if (rootHandler.getHelperObject(ExtSubReportReadHandler.ELEMENT_FACTORY_KEY) == null)
{
final ElementFactoryCollector elementFactory = new ElementFactoryCollector();
rootHandler.setHelperObject(ExtSubReportReadHandler.ELEMENT_FACTORY_KEY, elementFactory);
}
if (rootHandler.getHelperObject(ExtSubReportReadHandler.STYLE_FACTORY_KEY) == null)
{
final StyleKeyFactoryCollector styleKeyFactory = new StyleKeyFactoryCollector();
rootHandler.setHelperObject(ExtSubReportReadHandler.STYLE_FACTORY_KEY, styleKeyFactory);
}
if (rootHandler.getHelperObject(ExtSubReportReadHandler.CLASS_FACTORY_KEY) == null)
{
final ClassFactoryCollector classFactory = new ClassFactoryCollector();
classFactory.configure(rootHandler.getParserConfiguration());
rootHandler.setHelperObject(ExtSubReportReadHandler.CLASS_FACTORY_KEY, classFactory);
}
if (rootHandler.getHelperObject(ExtSubReportReadHandler.DATASOURCE_FACTORY_KEY) == null)
{
final DataSourceCollector dataSourceFactory = new DataSourceCollector();
dataSourceFactory.configure(rootHandler.getParserConfiguration());
rootHandler.setHelperObject(ExtSubReportReadHandler.DATASOURCE_FACTORY_KEY, dataSourceFactory);
}
if (rootHandler.getHelperObject(ExtSubReportReadHandler.TEMPLATE_FACTORY_KEY) == null)
{
final TemplateCollector templateFactory = new TemplateCollector();
templateFactory.configure(rootHandler.getParserConfiguration());
rootHandler.setHelperObject(ExtSubReportReadHandler.TEMPLATE_FACTORY_KEY, templateFactory);
}
report.setName(attrs.getValue(getUri(), "name"));
rootHandler.setHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME, report);
}