GXPARSE hosted by SourceForge.net Logo

ca.gorman.util.scan.spi
Class AbstractScanner

java.lang.Object
  extended by ca.gorman.util.scan.spi.AbstractScanner
All Implemented Interfaces:
Scanner

public abstract class AbstractScanner
extends Object
implements Scanner

A Scanner factory.


Constructor Summary
protected AbstractScanner()
           Create a scanner that uses the default thread factory for {#startScan(InputScanBuffer,Appendable,RuleList) asynchronous scanning}.
protected AbstractScanner(ThreadFactory threadFactory)
           Create a scanner that uses a specified thread factory for {#startScan(InputScanBuffer,Appendable,RuleList) asynchronous scanning}.
 
Method Summary
 void scan(CharSequence charSequence, Appendable appendable, RuleList ruleList)
           Set the scanner to initial condition, scan a CharSequence with fixed content, and output to an Appendable.
 void scan(CharSequence charSequence, Appendable appendable, RuleList ruleList, InputControl inputControl)
           Set the scanner to initial condition, scan a CharSequence with modifiable content, and output to an Appendable.
 void scan(Reader reader, Appendable appendable, RuleList ruleList)
           Set the scanner to initial condition, scan from a Reader, and output to an Appendable.
 AsynchronousScanState startScan(InputScanBuffer inputScanBuffer, Appendable appendable, RuleList ruleList)
           Start a new asynchonous scanner and return a view of its current state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScanner

protected AbstractScanner(ThreadFactory threadFactory)

Create a scanner that uses a specified thread factory for {#startScan(InputScanBuffer,Appendable,RuleList) asynchronous scanning}. scanning.

The thread factory is not used for synchronous scanning.


AbstractScanner

protected AbstractScanner()

Create a scanner that uses the default thread factory for {#startScan(InputScanBuffer,Appendable,RuleList) asynchronous scanning}.

The thread factory is not used for synchronous scanning.

Method Detail

startScan

public AsynchronousScanState startScan(InputScanBuffer inputScanBuffer,
                                       Appendable appendable,
                                       RuleList ruleList)
                                throws IOException,
                                       InterruptedException
Description copied from interface: Scanner

Start a new asynchonous scanner and return a view of its current state.

The Appendable will be flushed if it is a Flushable, and be closed if it is also a Closeable

Specified by:
startScan in interface Scanner
Parameters:
inputScanBuffer - a scannable source of character sequences
appendable - a default destination for output from the Scanner
ruleList - the scanning rules
Returns:
the Thread in which the scanner is running
Throws:
IOException - if an input or output error occurs
InterruptedException - if the thread is interrupted before this method returns

scan

public void scan(Reader reader,
                 Appendable appendable,
                 RuleList ruleList)
          throws IOException
Description copied from interface: Scanner

Set the scanner to initial condition, scan from a Reader, and output to an Appendable.

The Appendable will be flushed if it is a Flushable, but will not be closed if it is also a Closeable

Specified by:
scan in interface Scanner
Parameters:
reader - a source of characters to be scanned as input
appendable - a default destination for output from the Scanner
ruleList - the scanning rules
Throws:
IOException - if an input or output error occurs

scan

public void scan(CharSequence charSequence,
                 Appendable appendable,
                 RuleList ruleList)
          throws IOException
Description copied from interface: Scanner

Set the scanner to initial condition, scan a CharSequence with fixed content, and output to an Appendable.

The Appendable will be flushed if it is a Flushable, but will not be closed if it is also a Closeable

Specified by:
scan in interface Scanner
Parameters:
charSequence - a character sequence containing the characters to be scanned as input
appendable - a default destination for output from the Scanner
ruleList - the scanning rules
Throws:
IOException - if an output error occurs

scan

public void scan(CharSequence charSequence,
                 Appendable appendable,
                 RuleList ruleList,
                 InputControl inputControl)
          throws IOException
Description copied from interface: Scanner

Set the scanner to initial condition, scan a CharSequence with modifiable content, and output to an Appendable.

The Appendable will be flushed if it is a Flushable, but will not be closed if it is also a Closeable

Specified by:
scan in interface Scanner
Parameters:
charSequence - a character sequence containing the characters to be scanned as input
appendable - a default destination for output from the Scanner
ruleList - the scanning rules
inputControl - a control object that the Scanner can use to make additional characters available in the charSequence
Throws:
IOException - if an output error occurs

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