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

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


org.drools.decisiontable.parser.xls
Class PropertiesSheetListener

java.lang.Object
  extended by org.drools.decisiontable.parser.xls.PropertiesSheetListener
All Implemented Interfaces:
SheetListener

public class PropertiesSheetListener
extends Object
implements SheetListener

Reads an Excel sheet as key-value properties. Treats the first non-empty cell on a row as a key and any subsequent non-empty cell as a value. Any cells defined after the second cell are ignored as comments. Could be easily adapted to accept multiple values per key but the semantics were kept in line with Properties.

Author:
Shaun Addison

Field Summary
 
Fields inherited from interface org.drools.decisiontable.parser.SheetListener
NON_MERGED
 
Constructor Summary
PropertiesSheetListener()
           
 
Method Summary
 void finishSheet()
          Come to the end of the sheet.
 Properties getProperties()
          Return the key value pairs.
 void newCell(int row, int column, String value, int mergedColStart)
          Enter a new cell.
 void newRow(int rowNumber, int columns)
          Enter a new row.
 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
 

Constructor Detail

PropertiesSheetListener

public PropertiesSheetListener()
Method Detail

getProperties

public Properties getProperties()
Return the key value pairs. If this is called before the sheet is finished, then it will build the properties map with what is known. Subsequent calls will update the properties map.

Returns:
properties

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)
Enter a new row. This is ignored.

Specified by:
newRow in interface SheetListener
Parameters:
rowNumber - The row number.
columns - The Colum number.

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


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