private RuleModel getRuleModel( ExpandedDRLInfo expandedDRLInfo,
PackageDataModelOracle dmo ) {
//De-serialize model
RuleDescr ruleDescr = parseDrl( expandedDRLInfo );
RuleModel model = new RuleModel();
model.name = ruleDescr.getName();
model.parentName = ruleDescr.getParentName();
Map<String, AnnotationDescr> annotations = ruleDescr.getAnnotations();
if ( annotations != null ) {
for ( AnnotationDescr annotation : annotations.values() ) {
model.addMetadata( new RuleMetadata( annotation.getName(), annotation.getValuesAsString() ) );
}
}
//De-serialize Package name
final String packageName = PackageNameParser.parsePackageName( expandedDRLInfo.plainDrl );
model.setPackageName( packageName );
//De-serialize imports
final Imports imports = ImportsParser.parseImports( expandedDRLInfo.plainDrl );
for ( Import item : imports.getImports() ) {
model.getImports().addImport( item );
}
boolean isJavaDialect = parseAttributes( model,
ruleDescr.getAttributes() );
Map<String, String> boundParams = parseLhs( model, ruleDescr.getLhs(), expandedDRLInfo, dmo );