Drools Workbench - Common Model 6.2.0.CR1

org.drools.workbench.models.commons.backend.rule
Class RuleModelDRLPersistenceImpl.LHSPatternVisitor

java.lang.Object
  extended by org.drools.core.util.ReflectiveVisitor
      extended by org.drools.workbench.models.commons.backend.rule.RuleModelDRLPersistenceImpl.LHSPatternVisitor
All Implemented Interfaces:
org.drools.core.Visitor
Enclosing class:
RuleModelDRLPersistenceImpl

public static class RuleModelDRLPersistenceImpl.LHSPatternVisitor
extends org.drools.core.util.ReflectiveVisitor


Field Summary
protected  StringBuilder buf
           
protected  DRLConstraintValueBuilder constraintValueBuilder
           
protected  LHSGeneratorContextFactory generatorContextFactory
           
protected  LHSGeneratorContext rootContext
           
 
Fields inherited from class org.drools.core.util.ReflectiveVisitor
logger
 
Constructor Summary
RuleModelDRLPersistenceImpl.LHSPatternVisitor(boolean isDSLEnhanced, Map<String,IFactPattern> bindingsPatterns, Map<String,FieldConstraint> bindingsFields, DRLConstraintValueBuilder constraintValueBuilder, LHSGeneratorContextFactory generatorContextFactory, StringBuilder b, String indentation, boolean isPatternNegated)
           
 
Method Summary
protected  void addConnectiveFieldRestriction(StringBuilder buf, int type, String fieldType, String operator, Map<String,String> parameters, String value, ExpressionFormLine expression, LHSGeneratorContext gctx, boolean spaceBeforeOperator)
           
protected  void buildDefaultFieldValue(String operator, String value, StringBuilder buf)
           
protected  void buildExpressionFieldValue(ExpressionFormLine expression, StringBuilder buf)
           
protected  void buildLiteralFieldValue(String operator, int type, String fieldType, String value, StringBuilder buf)
           
protected  StringBuilder buildOperatorParameterDRL(Map<String,String> parameters)
           
protected  void buildReturnValueFieldValue(String value, StringBuilder buf)
           
protected  void buildTemplateFieldValue(int type, String fieldType, String value, StringBuilder buf)
           
protected  boolean doesPeerHaveOutput(LHSGeneratorContext gctx)
           
protected  void generateConstraint(FieldConstraint con, LHSGeneratorContext parentContext)
          Recursively process the nested constraints.
 void generateSeparator(FieldConstraint constr, LHSGeneratorContext gctx)
           
protected  void postGenerateNestedConnector(LHSGeneratorContext gctx)
           
protected  void postGenerateNestedConstraint(LHSGeneratorContext gctx)
           
protected  void postGeneratePattern(LHSGeneratorContext gctx)
           
protected  void preGenerateNestedConnector(LHSGeneratorContext gctx)
           
protected  void preGenerateNestedConstraint(LHSGeneratorContext gctx)
           
protected  void preGeneratePattern(LHSGeneratorContext gctx)
           
 void visitCompositeFactPattern(CompositeFactPattern pattern)
           
 void visitDSLSentence(DSLSentence sentence)
           
 void visitFactPattern(FactPattern pattern)
           
 void visitFreeFormLine(FreeFormLine ffl)
           
 void visitFromAccumulateCompositeFactPattern(FromAccumulateCompositeFactPattern pattern)
           
 void visitFromAccumulateCompositeFactPattern(FromAccumulateCompositeFactPattern pattern, boolean isSubPattern)
           
 void visitFromCollectCompositeFactPattern(FromCollectCompositeFactPattern pattern)
           
 void visitFromCollectCompositeFactPattern(FromCollectCompositeFactPattern pattern, boolean isSubPattern)
           
 void visitFromCompositeFactPattern(FromCompositeFactPattern pattern)
           
 void visitFromCompositeFactPattern(FromCompositeFactPattern pattern, boolean isSubPattern)
           
 void visitFromEntryPointFactPattern(FromEntryPointFactPattern pattern)
           
 void visitFromEntryPointFactPattern(FromEntryPointFactPattern pattern, boolean isSubPattern)
           
 
Methods inherited from class org.drools.core.util.ReflectiveVisitor
visit, visitObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

protected StringBuilder buf

constraintValueBuilder

protected DRLConstraintValueBuilder constraintValueBuilder

generatorContextFactory

protected LHSGeneratorContextFactory generatorContextFactory

rootContext

protected final LHSGeneratorContext rootContext
Constructor Detail

RuleModelDRLPersistenceImpl.LHSPatternVisitor

public RuleModelDRLPersistenceImpl.LHSPatternVisitor(boolean isDSLEnhanced,
                                                     Map<String,IFactPattern> bindingsPatterns,
                                                     Map<String,FieldConstraint> bindingsFields,
                                                     DRLConstraintValueBuilder constraintValueBuilder,
                                                     LHSGeneratorContextFactory generatorContextFactory,
                                                     StringBuilder b,
                                                     String indentation,
                                                     boolean isPatternNegated)
Method Detail

preGeneratePattern

protected void preGeneratePattern(LHSGeneratorContext gctx)

postGeneratePattern

protected void postGeneratePattern(LHSGeneratorContext gctx)

preGenerateNestedConnector

protected void preGenerateNestedConnector(LHSGeneratorContext gctx)

postGenerateNestedConnector

protected void postGenerateNestedConnector(LHSGeneratorContext gctx)

preGenerateNestedConstraint

protected void preGenerateNestedConstraint(LHSGeneratorContext gctx)

postGenerateNestedConstraint

protected void postGenerateNestedConstraint(LHSGeneratorContext gctx)

visitFactPattern

public void visitFactPattern(FactPattern pattern)

visitFreeFormLine

public void visitFreeFormLine(FreeFormLine ffl)

visitCompositeFactPattern

public void visitCompositeFactPattern(CompositeFactPattern pattern)

visitFromCompositeFactPattern

public void visitFromCompositeFactPattern(FromCompositeFactPattern pattern)

visitFromCompositeFactPattern

public void visitFromCompositeFactPattern(FromCompositeFactPattern pattern,
                                          boolean isSubPattern)

visitFromCollectCompositeFactPattern

public void visitFromCollectCompositeFactPattern(FromCollectCompositeFactPattern pattern)

visitFromCollectCompositeFactPattern

public void visitFromCollectCompositeFactPattern(FromCollectCompositeFactPattern pattern,
                                                 boolean isSubPattern)

visitFromAccumulateCompositeFactPattern

public void visitFromAccumulateCompositeFactPattern(FromAccumulateCompositeFactPattern pattern)

visitFromAccumulateCompositeFactPattern

public void visitFromAccumulateCompositeFactPattern(FromAccumulateCompositeFactPattern pattern,
                                                    boolean isSubPattern)

visitFromEntryPointFactPattern

public void visitFromEntryPointFactPattern(FromEntryPointFactPattern pattern)

visitFromEntryPointFactPattern

public void visitFromEntryPointFactPattern(FromEntryPointFactPattern pattern,
                                           boolean isSubPattern)

visitDSLSentence

public void visitDSLSentence(DSLSentence sentence)

generateSeparator

public void generateSeparator(FieldConstraint constr,
                              LHSGeneratorContext gctx)

doesPeerHaveOutput

protected boolean doesPeerHaveOutput(LHSGeneratorContext gctx)

generateConstraint

protected void generateConstraint(FieldConstraint con,
                                  LHSGeneratorContext parentContext)
Recursively process the nested constraints. It will only put brackets in for the ones that aren't at top level. This makes for more readable DRL in the most common cases.


addConnectiveFieldRestriction

protected void addConnectiveFieldRestriction(StringBuilder buf,
                                             int type,
                                             String fieldType,
                                             String operator,
                                             Map<String,String> parameters,
                                             String value,
                                             ExpressionFormLine expression,
                                             LHSGeneratorContext gctx,
                                             boolean spaceBeforeOperator)

buildReturnValueFieldValue

protected void buildReturnValueFieldValue(String value,
                                          StringBuilder buf)

buildOperatorParameterDRL

protected StringBuilder buildOperatorParameterDRL(Map<String,String> parameters)

buildLiteralFieldValue

protected void buildLiteralFieldValue(String operator,
                                      int type,
                                      String fieldType,
                                      String value,
                                      StringBuilder buf)

buildExpressionFieldValue

protected void buildExpressionFieldValue(ExpressionFormLine expression,
                                         StringBuilder buf)

buildTemplateFieldValue

protected void buildTemplateFieldValue(int type,
                                       String fieldType,
                                       String value,
                                       StringBuilder buf)

buildDefaultFieldValue

protected void buildDefaultFieldValue(String operator,
                                      String value,
                                      StringBuilder buf)

Drools Workbench - Common Model 6.2.0.CR1

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