org.drools.rule.builder.dialect.java
Class JavaDialect

java.lang.Object
  extended by org.drools.rule.builder.dialect.java.JavaDialect
All Implemented Interfaces:
Dialect

public class JavaDialect
extends Object
implements Dialect


Field Summary
protected static JavaAccumulateBuilder ACCUMULATE_BUILDER
           
protected static CollectBuilder COLLECT_BUIDER
           
protected static ConditionalBranchBuilder CONDITIONAL_BRANCH_BUILDER
           
protected static ConsequenceBuilder CONSEQUENCE_BUILDER
           
protected static EnabledBuilder ENABLED_BUILDER
           
protected static EntryPointBuilder ENTRY_POINT_BUILDER
           
protected static RuleConditionBuilder EVAL_BUILDER
           
protected static ForallBuilder FORALL_BUILDER
           
protected static MVELFromBuilder FROM_BUILDER
           
protected static JavaFunctionBuilder FUNCTION_BUILDER
           
protected static GroupElementBuilder GE_BUILDER
           
static String ID
           
protected static NamedConsequenceBuilder NAMED_CONSEQUENCE_BUILDER
           
protected static PatternBuilder PATTERN_BUILDER
           
protected static PredicateBuilder PREDICATE_BUILDER
           
protected static QueryBuilder QUERY_BUILDER
           
protected static ReturnValueBuilder RETURN_VALUE_BUILDER
           
protected static JavaRuleClassBuilder RULE_CLASS_BUILDER
           
protected static SalienceBuilder SALIENCE_BUILDER
           
protected static WindowReferenceBuilder WINDOW_REFERENCE_BUILDER
           
 
Constructor Summary
JavaDialect(PackageBuilder builder, PackageRegistry pkgRegistry, Package pkg)
           
 
Method Summary
 void addClassCompileTask(String className, BaseDescr descr, String text, MemoryResourceReader src, PackageBuilder.ErrorHandler handler)
          This adds a compile "task" for when the compiler of semantics (JCI) is called later on with compileAll()\ which actually does the compiling.
 void addClassName(String className)
           
 void addFunction(FunctionDescr functionDescr, TypeResolver typeResolver, org.drools.io.Resource resource)
           
 void addImport(ImportDescr importDescr)
           
 void addRule(RuleBuildContext context)
          This will add the rule for compiling later on.
 void addSrc(String resourceName, byte[] content)
           
 void addStaticImport(ImportDescr importDescr)
           
 AnalysisResult analyzeBlock(PackageBuildContext context, BaseDescr descr, String text, BoundIdentifiers availableIdentifiers)
           
 AnalysisResult analyzeExpression(PackageBuildContext context, BaseDescr descr, Object content, BoundIdentifiers availableIdentifiers)
           
 AnalysisResult analyzeExpression(PackageBuildContext context, BaseDescr descr, Object content, BoundIdentifiers availableIdentifiers, Map<String,Class<?>> localTypes)
           
 void compileAll()
          This actually triggers the compiling of all the resources.
 AccumulateBuilder getAccumulateBuilder()
           
 RuleConditionBuilder getBuilder(Class clazz)
           
 Map<Class<?>,EngineElementBuilder> getBuilders()
           
 ConsequenceBuilder getConsequenceBuilder()
           
 EnabledBuilder getEnabledBuilder()
           
 EntryPointBuilder getEntryPointBuilder()
           
 RuleConditionBuilder getEvalBuilder()
           
 String getExpressionDialectName()
           
 FromBuilder getFromBuilder()
           
 FunctionBuilder getFunctionBuilder()
           
 String getId()
           
 PackageRegistry getPackageRegistry()
           
 PatternBuilder getPatternBuilder()
           
 PredicateBuilder getPredicateBuilder()
           
 QueryBuilder getQueryBuilder()
           
 List<org.drools.builder.KnowledgeBuilderResult> getResults()
           
 ReturnValueBuilder getReturnValueBuilder()
           
 RuleClassBuilder getRuleClassBuilder()
           
 SalienceBuilder getSalienceBuilder()
           
 TypeResolver getTypeResolver()
          Returns the current type resolver instance
 void init(ProcessDescr processDescr)
           
 void init(RuleDescr ruleDescr)
           
static void initBuilder()
           
 void postCompileAddFunction(FunctionDescr functionDescr, TypeResolver typeResolver)
           
 void preCompileAddFunction(FunctionDescr functionDescr, TypeResolver typeResolver)
           
static void reinitBuilder()
           
static void setGEBuilder(GroupElementBuilder GE_BUILDER)
           
static void setPatternBuilder(PatternBuilder PATTERN_BUILDER)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

PATTERN_BUILDER

protected static PatternBuilder PATTERN_BUILDER

QUERY_BUILDER

protected static QueryBuilder QUERY_BUILDER

SALIENCE_BUILDER

protected static SalienceBuilder SALIENCE_BUILDER

ENABLED_BUILDER

protected static EnabledBuilder ENABLED_BUILDER

ACCUMULATE_BUILDER

protected static JavaAccumulateBuilder ACCUMULATE_BUILDER

EVAL_BUILDER

protected static RuleConditionBuilder EVAL_BUILDER

PREDICATE_BUILDER

protected static PredicateBuilder PREDICATE_BUILDER

RETURN_VALUE_BUILDER

protected static ReturnValueBuilder RETURN_VALUE_BUILDER

CONSEQUENCE_BUILDER

protected static ConsequenceBuilder CONSEQUENCE_BUILDER

RULE_CLASS_BUILDER

protected static JavaRuleClassBuilder RULE_CLASS_BUILDER

FROM_BUILDER

protected static MVELFromBuilder FROM_BUILDER

FUNCTION_BUILDER

protected static JavaFunctionBuilder FUNCTION_BUILDER

COLLECT_BUIDER

protected static CollectBuilder COLLECT_BUIDER

FORALL_BUILDER

protected static ForallBuilder FORALL_BUILDER

ENTRY_POINT_BUILDER

protected static EntryPointBuilder ENTRY_POINT_BUILDER

WINDOW_REFERENCE_BUILDER

protected static WindowReferenceBuilder WINDOW_REFERENCE_BUILDER

GE_BUILDER

protected static GroupElementBuilder GE_BUILDER

NAMED_CONSEQUENCE_BUILDER

protected static NamedConsequenceBuilder NAMED_CONSEQUENCE_BUILDER

CONDITIONAL_BRANCH_BUILDER

protected static ConditionalBranchBuilder CONDITIONAL_BRANCH_BUILDER
Constructor Detail

JavaDialect

public JavaDialect(PackageBuilder builder,
                   PackageRegistry pkgRegistry,
                   Package pkg)
Method Detail

setPatternBuilder

public static void setPatternBuilder(PatternBuilder PATTERN_BUILDER)

setGEBuilder

public static void setGEBuilder(GroupElementBuilder GE_BUILDER)

initBuilder

public static void initBuilder()

reinitBuilder

public static void reinitBuilder()

getBuilders

public Map<Class<?>,EngineElementBuilder> getBuilders()
Specified by:
getBuilders in interface Dialect

init

public void init(RuleDescr ruleDescr)
Specified by:
init in interface Dialect

init

public void init(ProcessDescr processDescr)
Specified by:
init in interface Dialect

getExpressionDialectName

public String getExpressionDialectName()
Specified by:
getExpressionDialectName in interface Dialect

analyzeExpression

public AnalysisResult analyzeExpression(PackageBuildContext context,
                                        BaseDescr descr,
                                        Object content,
                                        BoundIdentifiers availableIdentifiers)
Specified by:
analyzeExpression in interface Dialect

analyzeExpression

public AnalysisResult analyzeExpression(PackageBuildContext context,
                                        BaseDescr descr,
                                        Object content,
                                        BoundIdentifiers availableIdentifiers,
                                        Map<String,Class<?>> localTypes)

analyzeBlock

public AnalysisResult analyzeBlock(PackageBuildContext context,
                                   BaseDescr descr,
                                   String text,
                                   BoundIdentifiers availableIdentifiers)
Specified by:
analyzeBlock in interface Dialect

getTypeResolver

public TypeResolver getTypeResolver()
Returns the current type resolver instance

Specified by:
getTypeResolver in interface Dialect
Returns:

getBuilder

public RuleConditionBuilder getBuilder(Class clazz)
Specified by:
getBuilder in interface Dialect

getPatternBuilder

public PatternBuilder getPatternBuilder()
Specified by:
getPatternBuilder in interface Dialect

getQueryBuilder

public QueryBuilder getQueryBuilder()
Specified by:
getQueryBuilder in interface Dialect

getSalienceBuilder

public SalienceBuilder getSalienceBuilder()
Specified by:
getSalienceBuilder in interface Dialect

getEnabledBuilder

public EnabledBuilder getEnabledBuilder()
Specified by:
getEnabledBuilder in interface Dialect

getAccumulateBuilder

public AccumulateBuilder getAccumulateBuilder()
Specified by:
getAccumulateBuilder in interface Dialect

getEvalBuilder

public RuleConditionBuilder getEvalBuilder()
Specified by:
getEvalBuilder in interface Dialect

getPredicateBuilder

public PredicateBuilder getPredicateBuilder()
Specified by:
getPredicateBuilder in interface Dialect

getReturnValueBuilder

public ReturnValueBuilder getReturnValueBuilder()
Specified by:
getReturnValueBuilder in interface Dialect

getConsequenceBuilder

public ConsequenceBuilder getConsequenceBuilder()
Specified by:
getConsequenceBuilder in interface Dialect

getRuleClassBuilder

public RuleClassBuilder getRuleClassBuilder()
Specified by:
getRuleClassBuilder in interface Dialect

getFunctionBuilder

public FunctionBuilder getFunctionBuilder()

getFromBuilder

public FromBuilder getFromBuilder()
Specified by:
getFromBuilder in interface Dialect

getEntryPointBuilder

public EntryPointBuilder getEntryPointBuilder()
Specified by:
getEntryPointBuilder in interface Dialect

compileAll

public void compileAll()
This actually triggers the compiling of all the resources. Errors are mapped back to the element that originally generated the semantic code.

Specified by:
compileAll in interface Dialect

addRule

public void addRule(RuleBuildContext context)
This will add the rule for compiling later on. It will not actually call the compiler

Specified by:
addRule in interface Dialect

addFunction

public void addFunction(FunctionDescr functionDescr,
                        TypeResolver typeResolver,
                        org.drools.io.Resource resource)
Specified by:
addFunction in interface Dialect

preCompileAddFunction

public void preCompileAddFunction(FunctionDescr functionDescr,
                                  TypeResolver typeResolver)
Specified by:
preCompileAddFunction in interface Dialect

postCompileAddFunction

public void postCompileAddFunction(FunctionDescr functionDescr,
                                   TypeResolver typeResolver)
Specified by:
postCompileAddFunction in interface Dialect

addSrc

public void addSrc(String resourceName,
                   byte[] content)

addClassCompileTask

public void addClassCompileTask(String className,
                                BaseDescr descr,
                                String text,
                                MemoryResourceReader src,
                                PackageBuilder.ErrorHandler handler)
This adds a compile "task" for when the compiler of semantics (JCI) is called later on with compileAll()\ which actually does the compiling. The ErrorHandler is required to map the errors back to the element that caused it.


addClassName

public void addClassName(String className)

addImport

public void addImport(ImportDescr importDescr)
Specified by:
addImport in interface Dialect

addStaticImport

public void addStaticImport(ImportDescr importDescr)
Specified by:
addStaticImport in interface Dialect

getResults

public List<org.drools.builder.KnowledgeBuilderResult> getResults()
Specified by:
getResults in interface Dialect

getId

public String getId()
Specified by:
getId in interface Dialect

getPackageRegistry

public PackageRegistry getPackageRegistry()
Specified by:
getPackageRegistry in interface Dialect


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.