}
try
{
final RootXmlReadHandler rootHandler = getRootHandler();
final ResourceManager resourceManager = rootHandler.getResourceManager();
final ResourceKey source = rootHandler.getSource();
final HashMap map = new HashMap();
final String[] names = rootHandler.getHelperObjectNames();
for (int i = 0; i < names.length; i++)
{
final String name = names[i];
final FactoryParameterKey key = new FactoryParameterKey(name);
map.put(key, rootHandler.getHelperObject(name));
}
map.put(new FactoryParameterKey(ReportParserUtil.INCLUDE_PARSING_KEY), ReportParserUtil.INCLUDE_PARSING_VALUE);
final ResourceKey target = resourceManager.deriveKey(source, file, map);
final DependencyCollector dc = rootHandler.getDependencyCollector();
final Object maybeReport = getRootHandler().getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
if (maybeReport == null)
{
throw new ParseException("Illegal State: No valid report", getRootHandler().getDocumentLocator());
}
final Class targetType;
if (maybeReport instanceof SubReport)
{
targetType = SubReport.class;
}
else if (maybeReport instanceof MasterReport)
{
targetType = MasterReport.class;
}
else
{
throw new ParseException("Illegal State: No valid report", getRootHandler().getDocumentLocator());
}
final Resource resource = resourceManager.create(target, rootHandler.getContext(), targetType);
dc.add(resource);
}
catch (ResourceKeyCreationException e)
{