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)
{
throw new ParseException("Failure while building the resource-key.", e, getLocator());