public void compile(BRMSPackageBuilder builder,
AssetItem asset,
ContentPackageAssembler.ErrorLogger logger) throws DroolsParserException,
IOException {
DefaultExpander expander = getExpander( builder,
asset,
logger );
//add the rule keyword if its 'stand alone'
String source = asset.getContent();
if ( DRLFileContentHandler.isStandAloneRule( source ) ) {
String parentName = this.parentNameFromCategory( asset,
"" );
source = wrapRule( asset,
parentName,
source );
}
//expand and check for errors
String drl = expander.expand( source );
if ( expander.hasErrors() ) {
List exErrs = expander.getErrors();
for ( Iterator iter = exErrs.iterator(); iter.hasNext(); ) {
ExpanderException ex = (ExpanderException) iter.next();
logger.logError( new ContentAssemblyError( asset,
ex.getMessage() ) );
}