{
super.startParsing(attrs);
final String href = attrs.getValue(getUri(), "href");
if (href == null)
{
throw new ParseException("Required attribute 'href' is missing.", getLocator());
}
final ResourceKey key = getRootHandler().getSource();
final ResourceManager manager = getRootHandler().getResourceManager();
try
{
final ResourceKey derivedKey = manager.deriveKey(key, href);
final Resource resource = manager.create(derivedKey, null, ReportDataFactory.class);
getRootHandler().getDependencyCollector().add(resource);
dataFactory = (ReportDataFactory) resource.getResource();
}
catch (ResourceKeyCreationException e)
{
throw new ParseException
("Unable to derive key for " + key + " and " + href, getLocator());
}
catch (ResourceCreationException e)
{
throw new ParseException
("Unable to parse resource for " + key + " and " + href, getLocator());
}
catch (ResourceLoadingException e)
{
throw new ParseException
("Unable to load resource data for " + key + " and " + href, getLocator());
}
catch (ResourceException e)
{
throw new ParseException("Unable to parse resource for " + key + " and " + href, getLocator());
}
}