| java.lang.Object org.drools.compiler.PackageBuilder
All known Subclasses: org.drools.brms.server.builder.BRMSPackageBuilder,
PackageBuilder | public class PackageBuilder (Code) | | 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.
If you are using the Java dialect the JavaDialectConfiguration will attempt to
validate that the specified compiler is in the classpath, using ClassLoader.loasClass(String).
If you intented to just Janino sa the compiler you must either overload the compiler
property before instantiating this class or the PackageBuilder, or make sure Eclipse is in the
classpath, as Eclipse is the default.
|
Inner Class :abstract public static class ErrorHandler | |
Inner Class :public static class RuleErrorHandler extends ErrorHandler | |
Inner Class :public static class RuleInvokerErrorHandler extends RuleErrorHandler | |
Inner Class :public static class FunctionErrorHandler extends ErrorHandler | |
PackageBuilder | public PackageBuilder()(Code) | | Use this when package is starting from scratch.
|
PackageBuilder | public PackageBuilder(Package pkg)(Code) | | This will allow you to merge rules into this pre existing package.
|
PackageBuilder | public PackageBuilder(PackageBuilderConfiguration configuration)(Code) | | Pass a specific configuration for the PackageBuilder
Parameters: configuration - |
PackageBuilder | public PackageBuilder(Package pkg, PackageBuilderConfiguration configuration)(Code) | | This allows you to pass in a pre existing package, and a configuration
(for instance to set the classloader).
Parameters: pkg - A pre existing package (can be null if none exists) Parameters: configuration - Optional configuration for this builder. |
addPackage | public void addPackage(PackageDescr packageDescr)(Code) | | This adds a package from a Descr/AST This will also trigger a compile, if
there are any generated classes to compile of course.
|
addRuleFlow | public void addRuleFlow(Reader processSource)(Code) | | Add a ruleflow (.rt) asset to this package.
|
getClassFieldExtractorCache | public ClassFieldExtractorCache getClassFieldExtractorCache()(Code) | | Return the ClassFieldExtractorCache, this should only be used internally, and is subject to change
the ClsasFieldExtractorCache |
getErrors | public PackageBuilderErrors getErrors()(Code) | | A list of Error objects that resulted from building and compilingthe package. |
getPackage | public Package getPackage()(Code) | | The compiled package. The package may contain errors, which youcan report on by calling getErrors or printErrors. If you try toadd an invalid package (or rule) to a RuleBase, you will get aruntime exception.Compiled packages are serializable. |
getPackageBuilderConfiguration | public PackageBuilderConfiguration getPackageBuilderConfiguration()(Code) | | Return the PackageBuilderConfiguration for this PackageBuilder session
The PackageBuilderConfiguration |
getTypeResolver | public TypeResolver getTypeResolver()(Code) | | a Type resolver, lazily. If one does not exist yet, it will beinitialised. |
hasErrors | public boolean hasErrors()(Code) | | This will return true if there were errors in the package building and
compiling phase
|
resetErrors | protected void resetErrors()(Code) | | Reset the error list. This is useful when incrementally building
packages. Care should be used when building this, if you clear this when
there were errors on items that a rule depends on (eg functions), then
you will get spurious errors which will not be that helpful.
|
|
|