InputStream input;
try {
input = (InputStream) source;
} catch (ClassCastException e) {
throw new DefinitionsFactoryException(
"Invalid source type. Requires java.io.InputStream.", e);
}
try {
// set first object in stack
//digester.clear();
digester.push(this);
// parse
digester.parse(input);
} catch (SAXException e) {
throw new DefinitionsFactoryException(
"XML error reading definitions.", e);
} catch (IOException e) {
throw new DefinitionsFactoryException(
"I/O Error reading definitions.", e);
} finally {
digester.clear();
}