站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

DefaultRuleSheetListener (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.decisiontable.parser
Class DefaultRuleSheetListener

java.lang.Object
  extended by org.drools.decisiontable.parser.DefaultRuleSheetListener
All Implemented Interfaces:
RuleSheetListener, SheetListener
Direct Known Subclasses:
RuleMatrixSheetListener

public class DefaultRuleSheetListener
extends Object
implements RuleSheetListener

Author:
Shaun Addison Michael Neale Define a ruleset spreadsheet which contains one or more decision tables. Stay calm, deep breaths... this is a little bit scary, its where it all happens. A table is identifed by a cell beginning with the text "RuleTable". The first row after the table identifier defines the column type: either a condition ("C") or consequence ("A" for action), and so on. The second row contains ObjectType declarations (optionally, or can be left blank). If cells are merged, then all snippets below the merged bit will become part of the same column as seperate constraints. The third row identifies the java code block associated with the condition or consequence. This code block will include a parameter marker for the attribute defined by that column. The third row is a label for the attribute associated with that column. All subsequent rows identify rules with the set.

Field Summary
static String FUNCTIONS_TAG
           
static String IMPORT_TAG
           
static String RULE_TABLE_TAG
           
static String RULESET_TAG
           
static String SEQUENTIAL_FLAG
           
static String VARIABLES_TAG
           
 
Fields inherited from interface org.drools.decisiontable.parser.SheetListener
NON_MERGED
 
Constructor Summary
DefaultRuleSheetListener()
           
 
Method Summary
protected  void addRule(Rule newRule)
          Add a new rule to the current list of rules
 void finishSheet()
          Come to the end of the sheet.
protected  Rule getCurrentRule()
           
 Properties getProperties()
          Return the rule sheet properties
 Package getRuleSet()
          Build the final ruleset as parsed.
 void newCell(int row, int column, String value, int mergedColStart)
          Enter a new cell.
 void newRow(int rowNumber, int columns)
          Enter a new row.
protected  void postInitRuleTable(int row, int column, String value)
          Called after rule table initialisation.
protected  void preInitRuleTable(int row, int column, String value)
          Called before rule table initialisation.
 void startSheet(String name)
          Start a new sheet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FUNCTIONS_TAG

public static final String FUNCTIONS_TAG
See Also:
Constant Field Values

IMPORT_TAG

public static final String IMPORT_TAG
See Also:
Constant Field Values

SEQUENTIAL_FLAG

public static final String SEQUENTIAL_FLAG
See Also:
Constant Field Values

VARIABLES_TAG

public static final String VARIABLES_TAG
See Also:
Constant Field Values

RULE_TABLE_TAG

public static final String RULE_TABLE_TAG
See Also:
Constant Field Values

RULESET_TAG

public static final String RULESET_TAG
See Also:
Constant Field Values
Constructor Detail

DefaultRuleSheetListener

public DefaultRuleSheetListener()
Method Detail

getProperties

public Properties getProperties()
Description copied from interface: RuleSheetListener
Return the rule sheet properties

Specified by:
getProperties in interface RuleSheetListener

getRuleSet

public Package getRuleSet()
Description copied from interface: RuleSheetListener
Build the final ruleset as parsed.

Specified by:
getRuleSet in interface RuleSheetListener

addRule

protected void addRule(Rule newRule)
Add a new rule to the current list of rules

Parameters:
rule -

startSheet

public void startSheet(String name)
Description copied from interface: SheetListener
Start a new sheet

Specified by:
startSheet in interface SheetListener
Parameters:
name - the sheet name

finishSheet

public void finishSheet()
Description copied from interface: SheetListener
Come to the end of the sheet.

Specified by:
finishSheet in interface SheetListener

newRow

public void newRow(int rowNumber,
                   int columns)
Description copied from interface: SheetListener
Enter a new row.

Specified by:
newRow in interface SheetListener

newCell

public void newCell(int row,
                    int column,
                    String value,
                    int mergedColStart)
Description copied from interface: SheetListener
Enter a new cell. Do NOT call this event for trailling cells at the end of the line. It will just confuse the parser. If all the trailing cells are empty, just stop raising events.

Specified by:
newCell in interface SheetListener
Parameters:
row - the row number
column - the column alpha character label
value - the string value of the cell

preInitRuleTable

protected void preInitRuleTable(int row,
                                int column,
                                String value)
Called before rule table initialisation. Subclasses may override this method to do additional processing.


getCurrentRule

protected Rule getCurrentRule()

postInitRuleTable

protected void postInitRuleTable(int row,
                                 int column,
                                 String value)
Called after rule table initialisation. Subclasses may override this method to do additional processing.



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