Class PropertiesSheetListener
- java.lang.Object
-
- org.drools.decisiontable.parser.xls.PropertiesSheetListener
-
- All Implemented Interfaces:
org.drools.template.parser.DataListener
public class PropertiesSheetListener extends Object implements org.drools.template.parser.DataListener
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPropertiesSheetListener.CaseInsensitiveMap
-
Constructor Summary
Constructors Constructor Description PropertiesSheetListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishSheet()PropertiesSheetListener.CaseInsensitiveMapgetProperties()Return the key value pairs.voidnewCell(int row, int column, String value, int mergedColStart)voidnewRow(int rowNumber, int columns)Enter a new row.voidstartSheet(String name)
-
-
-
Method Detail
-
getProperties
public PropertiesSheetListener.CaseInsensitiveMap 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)
- Specified by:
startSheetin interfaceorg.drools.template.parser.DataListener
-
finishSheet
public void finishSheet()
- Specified by:
finishSheetin interfaceorg.drools.template.parser.DataListener
-
newRow
public void newRow(int rowNumber, int columns)Enter a new row. This is ignored.- Specified by:
newRowin interfaceorg.drools.template.parser.DataListener- Parameters:
rowNumber- The row number.columns- The Colum number.
-
newCell
public void newCell(int row, int column, String value, int mergedColStart)- Specified by:
newCellin interfaceorg.drools.template.parser.DataListener
-
-