|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.drools.compiler.PackageBuilder
public class PackageBuilder
This is the main compiler class for parsing and compiling rules and assembling or merging them into a binary Package instance. This can be done by merging into existing binary packages, or totally from source.
| Nested Class Summary | |
|---|---|
static class |
PackageBuilder.ErrorHandler
This is the super of the error handlers. |
static class |
PackageBuilder.FunctionErrorHandler
|
static class |
PackageBuilder.MissingPackageNameException
|
static class |
PackageBuilder.RuleErrorHandler
|
static class |
PackageBuilder.RuleInvokerErrorHandler
There isn't much point in reporting invoker errors, as they are no help. |
| Constructor Summary | |
|---|---|
PackageBuilder()
Use this when package is starting from scratch. |
|
PackageBuilder(Package pkg)
This will allow you to merge rules into this pre existing package. |
|
PackageBuilder(PackageBuilderConfiguration configuration)
|
|
PackageBuilder(Package pkg,
PackageBuilderConfiguration configuration)
This allows you to pass in a pre existing package, and a configuration (for instance to set the classloader). |
|
| Method Summary | |
|---|---|
void |
addPackage(PackageDescr packageDescr)
This adds a package from a Descr/AST This will also trigger a compile, if there are any generated classes to compile of course. |
void |
addPackageFromDrl(Reader reader)
Load a rule package from DRL source. |
void |
addPackageFromDrl(Reader source,
Reader dsl)
Load a rule package from DRL source using the supplied DSL configuration. |
void |
addPackageFromXml(Reader reader)
Load a rule package from XML source. |
PackageBuilderErrors |
getErrors()
|
Package |
getPackage()
|
boolean |
hasErrors()
This will return true if there were errors in the package building and compiling phase |
protected void |
resetErrors()
Reset the error list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackageBuilder()
public PackageBuilder(Package pkg)
public PackageBuilder(PackageBuilderConfiguration configuration)
public PackageBuilder(Package pkg, PackageBuilderConfiguration configuration)
pkg - A pre existing package (can be null if none exists)configuration - Optional configuration for this builder.| Method Detail |
|---|
public void addPackageFromDrl(Reader reader) throws DroolsParserException, IOException
reader -
DroolsParserException
IOExceptionpublic void addPackageFromXml(Reader reader) throws DroolsParserException, IOException
reader -
DroolsParserException
IOExceptionpublic void addPackageFromDrl(Reader source, Reader dsl) throws DroolsParserException, IOException
source - The source of the rules.dsl - The source of the domain specific language configuration.
DroolsParserException
IOExceptionpublic void addPackage(PackageDescr packageDescr)
public Package getPackage()
public boolean hasErrors()
public PackageBuilderErrors getErrors()
protected void resetErrors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||