org.drools.guvnor.server.contenthandler
Class DRLFileContentHandler

java.lang.Object
  extended by org.drools.guvnor.server.contenthandler.ContentHandler
      extended by org.drools.guvnor.server.contenthandler.PlainTextContentHandler
          extended by org.drools.guvnor.server.contenthandler.DRLFileContentHandler
All Implemented Interfaces:
ICompilable, IRuleAsset

public class DRLFileContentHandler
extends PlainTextContentHandler
implements IRuleAsset


Constructor Summary
DRLFileContentHandler()
           
 
Method Summary
 void assembleDRL(BRMSPackageBuilder builder, AssetItem asset, StringBuilder stringBuilder)
          This will be called when a rule asset is to render itself to DRL source.
 void assembleDRL(BRMSPackageBuilder builder, RuleAsset asset, StringBuilder stringBuilder)
           
 void compile(BRMSPackageBuilder builder, AssetItem asset, ContentPackageAssembler.ErrorLogger logger)
          This will be called when the asset is required to compile itself, in the context of the given builder.
 void compile(BRMSPackageBuilder builder, RuleAsset asset, ContentPackageAssembler.ErrorLogger logger)
           
 String getRawDRL(AssetItem asset)
          If the rule has DSL in it, it is presented unexpanded.
static boolean isStandAloneRule(String content)
          This will try and sniff ouf if its a stand alone rule which will use the asset name as the rule name, or if it should be treated as a package (in the latter case, the content is passed as it to the compiler).
 
Methods inherited from class org.drools.guvnor.server.contenthandler.PlainTextContentHandler
retrieveAssetContent, storeAssetContent
 
Methods inherited from class org.drools.guvnor.server.contenthandler.ContentHandler
isRuleAsset, parentNameFromCategory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DRLFileContentHandler

public DRLFileContentHandler()
Method Detail

compile

public void compile(BRMSPackageBuilder builder,
                    AssetItem asset,
                    ContentPackageAssembler.ErrorLogger logger)
             throws org.drools.compiler.DroolsParserException,
                    IOException
Description copied from interface: ICompilable
This will be called when the asset is required to compile itself, in the context of the given builder.

Specified by:
compile in interface ICompilable
Throws:
org.drools.compiler.DroolsParserException
IOException

compile

public void compile(BRMSPackageBuilder builder,
                    RuleAsset asset,
                    ContentPackageAssembler.ErrorLogger logger)
             throws org.drools.compiler.DroolsParserException,
                    IOException
Specified by:
compile in interface ICompilable
Throws:
org.drools.compiler.DroolsParserException
IOException

isStandAloneRule

public static boolean isStandAloneRule(String content)
This will try and sniff ouf if its a stand alone rule which will use the asset name as the rule name, or if it should be treated as a package (in the latter case, the content is passed as it to the compiler).


assembleDRL

public void assembleDRL(BRMSPackageBuilder builder,
                        RuleAsset asset,
                        StringBuilder stringBuilder)
Specified by:
assembleDRL in interface IRuleAsset

assembleDRL

public void assembleDRL(BRMSPackageBuilder builder,
                        AssetItem asset,
                        StringBuilder stringBuilder)
Description copied from interface: IRuleAsset
This will be called when a rule asset is to render itself to DRL source.

Specified by:
assembleDRL in interface IRuleAsset

getRawDRL

public String getRawDRL(AssetItem asset)
Description copied from interface: IRuleAsset
If the rule has DSL in it, it is presented unexpanded.

Specified by:
getRawDRL in interface IRuleAsset


Copyright © 2001-2011 JBoss Inc.. All Rights Reserved.