if (anyhandler2!=null) exceptionHandlers.add(anyhandler2);
}
private ExceptionHandler parse(String fileName) throws DocumentException, ClassNotFoundException
{
ExceptionHandler anyhandler = null;
InputStream stream = Resources.getResourceAsStream(fileName);
if (stream!=null)
{
log.debug("reading exception mappings from " + fileName);
List<Element> elements = XML.getRootElement(stream).elements("exception");
for (final Element exception: elements)
{
String className = exception.attributeValue("class");
if (className==null)
{
anyhandler = createHandler(exception, Exception.class);
}
else
{
ExceptionHandler handler = createHandler( exception, Reflections.classForName(className) );
if (handler!=null) exceptionHandlers.add(handler);
}
}
}
return anyhandler;