SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(false);
SAXParser parser = factory.newSAXParser();
ClassElementHandler handler = new ClassElementHandler();
for (String resourceName : resource)
{
InputStream is = getClass().getClassLoader().getResourceAsStream(resourceName);
if (is == null)
{
is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName);
}
if (is == null)
{
throw new Exception("Could not locate resource :" + resourceName);
}
parser.parse(is, handler);
}
className.addAll(handler.getClassName());
}