com.townleyenterprises.io
Class DelimitedLineProcessor

java.lang.Object
  extended bycom.townleyenterprises.io.AbstractLineProcessor
      extended bycom.townleyenterprises.io.DelimitedLineProcessor
All Implemented Interfaces:
LineProcessor

public abstract class DelimitedLineProcessor
extends AbstractLineProcessor

This class provides the capability to break a line of delimited text into a list of objects representing each value.

Since:
2.1
Version:
$Id: DelimitedLineProcessor.java,v 1.2 2004/11/06 19:15:36 atownley Exp $
Author:
Andrew S. Townley

Constructor Summary
DelimitedLineProcessor(java.lang.String delim)
          The constructor initializes the processor with the delimiter to be used.
 
Method Summary
abstract  void processItems(java.util.List list)
          This method gets called after the input line has been broken up into the individual tokens.
 void processLine(java.lang.String line)
          This method gets called for each line processed containing the text of the line.
 void reset()
          This method does nothing.
 
Methods inherited from class com.townleyenterprises.io.AbstractLineProcessor
getLineCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimitedLineProcessor

public DelimitedLineProcessor(java.lang.String delim)
The constructor initializes the processor with the delimiter to be used.

Parameters:
delim - the delimiter
Method Detail

processLine

public void processLine(java.lang.String line)
                 throws java.lang.Exception
This method gets called for each line processed containing the text of the line.

Specified by:
processLine in interface LineProcessor
Overrides:
processLine in class AbstractLineProcessor
Parameters:
line - the line of the input file
Throws:
java.lang.Exception - if an error occurs processing the line

processItems

public abstract void processItems(java.util.List list)
                           throws java.lang.Exception
This method gets called after the input line has been broken up into the individual tokens.

Parameters:
list - the list to process
Throws:
java.lang.Exception - if something goes wrong processing the items

reset

public void reset()
This method does nothing.

Specified by:
reset in interface LineProcessor
Overrides:
reset in class AbstractLineProcessor


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.