GXPARSE hosted by SourceForge.net Logo

ca.gorman.util.scan
Class ScanningReader

java.lang.Object
  extended by java.io.Reader
      extended by ca.gorman.util.scan.ScanningReader
All Implemented Interfaces:
Closeable, Readable

public class ScanningReader
extends Reader

A Reader with a character scanning and matching preprocessor.


Constructor Summary
  ScanningReader(Reader reader, RuleList ruleList)
           Construct with a RuleList.
  ScanningReader(Reader reader, ScanRule... scanRule)
           Construct with one or more ScanRules.
protected ScanningReader(ScannerFactory scannerFactory, Reader reader, RuleList ruleList)
           Construct with a RuleList and a different Scanner.
 
Method Summary
 void close()
           
 int read()
           
 int read(char[] chr, int offset, int length)
           
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScanningReader

protected ScanningReader(ScannerFactory scannerFactory,
                         Reader reader,
                         RuleList ruleList)
                  throws IOException,
                         InterruptedException

Construct with a RuleList and a different Scanner.

Parameters:
scannerFactory - your favourite Scanner implementation
reader - the source of characters to be scanned
ruleList - a list of scanning rules
Throws:
IOException
InterruptedException

ScanningReader

public ScanningReader(Reader reader,
                      RuleList ruleList)
               throws IOException,
                      InterruptedException

Construct with a RuleList.

Parameters:
reader - the source of characters to be scanned
ruleList - a list of scanning rules
Throws:
IOException
InterruptedException

ScanningReader

public ScanningReader(Reader reader,
                      ScanRule... scanRule)
               throws IOException,
                      InterruptedException

Construct with one or more ScanRules.

Parameters:
reader - the source of characters to be scanned
scanRule - one or more scanning rules, or an array of scanning rules
Throws:
IOException
InterruptedException
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Reader
Throws:
IOException

read

public int read()
         throws IOException
Overrides:
read in class Reader
Throws:
IOException

read

public int read(char[] chr,
                int offset,
                int length)
         throws IOException
Specified by:
read in class Reader
Throws:
IOException

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License