* @throws DroolsParserException
* @throws IOException
*/
public void addPackageFromXml( final Reader reader ) throws DroolsParserException, IOException {
this.resource = new ReaderResource( reader, ResourceType.XDRL );
final XmlPackageReader xmlReader = new XmlPackageReader( this.configuration.getSemanticModules() );
xmlReader.getParser().setClassLoader( this.rootClassLoader );
try {
xmlReader.read( reader );
} catch (final SAXException e) {
throw new DroolsParserException( e.toString(),
e.getCause() );
}
addPackage( xmlReader.getPackageDescr() );
this.resource = null;
}