com.ricebridge.csvman
Class HeadersListenerSupport

java.lang.Object
  extended bycom.ricebridge.csvman.LineListenerSupportImpl
      extended bycom.ricebridge.csvman.CustomLineListener
          extended bycom.ricebridge.csvman.HeadersListenerSupport
All Implemented Interfaces:
LineListener
Direct Known Subclasses:
ResultSetLineListener, TableModelLineListener

public abstract class HeadersListenerSupport
extends CustomLineListener

Extension of CustomLineListener that handles headers in the CSV file.

You must still subclass this class. This class does not actually store the headers, it just handles the has headers setting. Headers, if present, should be stored by the implementing subclass in an appropriate manner.

Compatibility Note: the setHasHeaders(boolean) method has been replaced by the TableModelLineListener.PROP_TableModel_dataHasHeaders and ResultSetLineListener.PROP_ResultSet_dataHasHeaders settings for the CsvSpec class. This support class is retained for compatibility with Csv Manager 1.1 and will be removed in the 2.x product line.

The Source Code of this Java class is available under a BSD-style license.


Field Summary
protected  boolean iHasHeaders
          The data fields of first line of the CSV file may be column headers.
 
Constructor Summary
HeadersListenerSupport()
           
 
Method Summary
 boolean getHasHeaders()
          Get the value of the has headers setting.
 void setHasHeaders(boolean pHasHeaders)
          The data fields of first line of the CSV file may be column headers.
 
Methods inherited from class com.ricebridge.csvman.CustomLineListener
endProcessImpl, handleBadLineImpl, handleLineImpl, setCsvSpecImpl, setLineSpecImpl, startProcessImpl
 
Methods inherited from class com.ricebridge.csvman.LineListenerSupportImpl
endProcess, handleBadLine, handleLine, setCsvSpec, setLineSpec, startProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iHasHeaders

protected boolean iHasHeaders
The data fields of first line of the CSV file may be column headers.

Constructor Detail

HeadersListenerSupport

public HeadersListenerSupport()
Method Detail

setHasHeaders

public void setHasHeaders(boolean pHasHeaders)
The data fields of first line of the CSV file may be column headers.

When pHasHeaders is true, the first line of the CSV file is considered to consist of column header names rather than normal data.

When pHasHeaders is false, the first line of the CSV file is considered to be normal data and default column names are used.

In the case where there are no column names, or not enough column names, the default form Column X is used, where X is the number of the column, counting from 1.

Parameters:
pHasHeaders - first line is header names
See Also:
CsvTableModel.setHasHeaders(boolean)

getHasHeaders

public boolean getHasHeaders()
Get the value of the has headers setting.

See Also:
setHasHeaders(boolean)


Copyright © 2003-2006 Ricebridge