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

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


org.drools.decisiontable
Class SpreadsheetCompiler

java.lang.Object
  extended by org.drools.decisiontable.SpreadsheetCompiler

public class SpreadsheetCompiler
extends Object

Author:
Michael Neale This class handles the input XLS and CSV and extracts the rule DRL, ready for pumping into drools.

Constructor Summary
SpreadsheetCompiler()
           
 
Method Summary
 String compile(InputStream xlsStream, InputType type)
          Generates DRL from the input stream containing the spreadsheet.
 String compile(InputStream xlsStream, InputType type, RuleSheetListener listener)
          Generates DRL from the input stream containing the spreadsheet.
 String compile(InputStream stream, String worksheetName)
          Looks for a named worksheet to find the decision tables on.
 String compile(String classPathResource, InputType inputType)
          Convenience implementation, taking rules from the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpreadsheetCompiler

public SpreadsheetCompiler()
Method Detail

compile

public String compile(InputStream xlsStream,
                      InputType type)
Generates DRL from the input stream containing the spreadsheet.

Parameters:
xlsStream - The stream to the spreadsheet. Uses the first worksheet found for the decision tables, ignores others.
Returns:
DRL xml, ready for use in drools.

compile

public String compile(InputStream xlsStream,
                      InputType type,
                      RuleSheetListener listener)
Generates DRL from the input stream containing the spreadsheet.

Parameters:
xlsStream - The stream to the spreadsheet. Uses the first worksheet found for the decision tables, ignores others.
type - The type of the file - InputType.CSV or InputType.XLS
listener -
Returns:
DRL xml, ready for use in drools.

compile

public String compile(String classPathResource,
                      InputType inputType)
Convenience implementation, taking rules from the classpath. It is recommended to use the stream version, as you can then change rules dynamically. (that is a lot of the benefit of rule engines !).

Parameters:
classPathResource - full class path to the spreadsheet you wish to convert to DRL. Uses the first worksheet for the decision tables.
Returns:
DRL.

compile

public String compile(InputStream stream,
                      String worksheetName)
Looks for a named worksheet to find the decision tables on. Only works with XLS format spreadsheets (as they have multiple worksheets).

Parameters:
stream - The stream of the decision tables (spreadsheet) IN XLS format !!
worksheetName - The name of the worksheet that the decision tables live on.
Returns:
DRL, ready to go.


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