xelem.3.0

nl.fountain.xelem.lex
Class DefaultExcelReaderFilter

java.lang.Object
  extended by nl.fountain.xelem.lex.DefaultExcelReaderFilter
All Implemented Interfaces:
ExcelReaderFilter, ExcelReaderListener

public class DefaultExcelReaderFilter
extends Object
implements ExcelReaderFilter

Passes all events, values and instances unfiltered. It's up to the subclasses of this class to take appropriate filtering action.

Since:
xelem.2.0

Constructor Summary
DefaultExcelReaderFilter()
           
 
Method Summary
 void addExcelReaderListener(ExcelReaderListener listener)
          Registers the given listener.
 void clearExcelReaderListeners()
          Remove all registered listeners.
 void endDocument(Map<String,String> prefixMap)
          Passes the event unfiltered to it's listeners.
 void endWorksheet(int sheetIndex, String sheetName)
          Passes the event unfiltered to it's listeners.
 List<ExcelReaderListener> getListeners()
          Gets a list of registered listeners.
 void processingInstruction(String target, String data)
          Passes the event unfiltered to it's listeners.
 boolean removeExcelReaderListener(ExcelReaderListener listener)
          Remove the specified listener.
 void setAutoFilter(int sheetIndex, String sheetName, AutoFilter autoFilter)
          Passes the event unfiltered to it's listeners.
 void setCell(int sheetIndex, String sheetName, int rowIndex, Cell cell)
          Passes the event unfiltered to it's listeners.
 void setColumn(int sheetIndex, String sheetName, Column column)
          Passes the event unfiltered to it's listeners.
 void setDocumentProperties(DocumentProperties docProps)
          Passes the event unfiltered to it's listeners.
 void setExcelWorkbook(ExcelWorkbook excelWb)
          Passes the event unfiltered to it's listeners.
 void setNamedRange(int sheetIndex, String sheetName, NamedRange namedRange)
          Passes the event unfiltered to it's listeners.
 void setNamedRange(NamedRange namedRange)
          Passes the event unfiltered to it's listeners.
 void setRow(int sheetIndex, String sheetName, Row row)
          Passes the event unfiltered to it's listeners.
 void setWorksheetOptions(int sheetIndex, String sheetName, WorksheetOptions wsOptions)
          Passes the event unfiltered to it's listeners.
 void startDocument()
          Passes the event unfiltered to it's listeners.
 void startTable(int sheetIndex, String sheetName, Table table)
          Passes the event unfiltered to it's listeners.
 void startWorkbook(String systemID)
          Passes the event unfiltered to it's listeners.
 void startWorksheet(int sheetIndex, Worksheet sheet)
          Passes the event unfiltered to it's listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExcelReaderFilter

public DefaultExcelReaderFilter()
Method Detail

getListeners

public List<ExcelReaderListener> getListeners()
Description copied from interface: ExcelReaderFilter
Gets a list of registered listeners.

Specified by:
getListeners in interface ExcelReaderFilter
Returns:
a list of registered listeners

addExcelReaderListener

public void addExcelReaderListener(ExcelReaderListener listener)
Description copied from interface: ExcelReaderFilter
Registers the given listener.

Specified by:
addExcelReaderListener in interface ExcelReaderFilter
Parameters:
listener - the listener to be registered

removeExcelReaderListener

public boolean removeExcelReaderListener(ExcelReaderListener listener)
Description copied from interface: ExcelReaderFilter
Remove the specified listener.

Specified by:
removeExcelReaderListener in interface ExcelReaderFilter
Parameters:
listener - the listener to be removed
Returns:
true if the given listener was registered with this ExcelReaderFilter, false otherwise.

clearExcelReaderListeners

public void clearExcelReaderListeners()
Description copied from interface: ExcelReaderFilter
Remove all registered listeners.

Specified by:
clearExcelReaderListeners in interface ExcelReaderFilter

startDocument

public void startDocument()
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
startDocument in interface ExcelReaderListener

processingInstruction

public void processingInstruction(String target,
                                  String data)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
processingInstruction in interface ExcelReaderListener
Parameters:
target - the target of the processing instruction
data - the data of the processing instruction

startWorkbook

public void startWorkbook(String systemID)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
startWorkbook in interface ExcelReaderListener
Parameters:
systemID - the systemID or "source" if no systemID was encountered

setDocumentProperties

public void setDocumentProperties(DocumentProperties docProps)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setDocumentProperties in interface ExcelReaderListener
Parameters:
docProps - fully populated instance of DocumentProperties

setExcelWorkbook

public void setExcelWorkbook(ExcelWorkbook excelWb)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setExcelWorkbook in interface ExcelReaderListener
Parameters:
excelWb - fully populated instance of ExcelWorkbook

setNamedRange

public void setNamedRange(NamedRange namedRange)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setNamedRange in interface ExcelReaderListener
Parameters:
namedRange - fully populated instance of NamedRange

startWorksheet

public void startWorksheet(int sheetIndex,
                           Worksheet sheet)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
startWorksheet in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the encountered sheet. 0-based.
sheet - dummy instance of Worksheet. Only the (xml-)attributes of the Worksheet-element have been set on the instance

setNamedRange

public void setNamedRange(int sheetIndex,
                          String sheetName,
                          NamedRange namedRange)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setNamedRange in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the namedRange was found
namedRange - fully populated instance of NamedRange

startTable

public void startTable(int sheetIndex,
                       String sheetName,
                       Table table)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
startTable in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the table was found
table - dummy instance of Table. Only the (xml-)attributes of the Table-element have been set on the instance

setColumn

public void setColumn(int sheetIndex,
                      String sheetName,
                      Column column)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setColumn in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the column was found
column - fully populated instance of Column

setRow

public void setRow(int sheetIndex,
                   String sheetName,
                   Row row)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setRow in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the row was found
row - fully populated instance of Row

setCell

public void setCell(int sheetIndex,
                    String sheetName,
                    int rowIndex,
                    Cell cell)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setCell in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the cell was found
rowIndex - the index of the row
cell - fully populated instance of Cell

setWorksheetOptions

public void setWorksheetOptions(int sheetIndex,
                                String sheetName,
                                WorksheetOptions wsOptions)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setWorksheetOptions in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the worksheetOptions was found
wsOptions - fully populated instance of WorksheetOptions

setAutoFilter

public void setAutoFilter(int sheetIndex,
                          String sheetName,
                          AutoFilter autoFilter)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
setAutoFilter in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet where the autoFilter was found
autoFilter - fully populated instance of AutoFilter

endWorksheet

public void endWorksheet(int sheetIndex,
                         String sheetName)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
endWorksheet in interface ExcelReaderListener
Parameters:
sheetIndex - the index of the worksheet (0-based)
sheetName - the name of the worksheet

endDocument

public void endDocument(Map<String,String> prefixMap)
Passes the event unfiltered to it's listeners. Subclasses can override this method and take appropriate action.

Specified by:
endDocument in interface ExcelReaderListener
Parameters:
prefixMap - a map of prefixes (keys) and uri's recieved while reading

xelem.3.0