GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse.toolkit
Class CoroutineCharacters<T extends Parser>

java.lang.Object
  extended by ca.gorman.xml.parse.toolkit.Coroutine_NoCallback<T>
      extended by ca.gorman.xml.parse.toolkit.CoroutineCharacters<T>
All Implemented Interfaces:
Runnable

public final class CoroutineCharacters<T extends Parser>
extends Coroutine_NoCallback<T>
implements Runnable

Invokes character handler from the parser thread to run in the application thread.


Constructor Summary
  CoroutineCharacters()
           Construct instance that cannot be used until initialized by setListener and setParams.
protected CoroutineCharacters(Listener<T> listener)
           Construct instance that cannot be used until initialized by setParams.
protected CoroutineCharacters(Listener<T> listener, CharSequence CharSequence)
           Construct fully initialized instance, ready for immediate use.
 
Method Summary
 Listener<T> getListener()
           Get the listener.
 void run()
           Execute a callback from the parser thread to run the character handler in the application thread.
 void setListener(Listener<T> listener)
           Set or reset the listener.
 void setParams(CharSequence charSequence)
           Set or reset data to be sent to the character handler.
 
Methods inherited from class ca.gorman.xml.parse.toolkit.Coroutine_NoCallback
getParser, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoroutineCharacters

public CoroutineCharacters()

Construct instance that cannot be used until initialized by setListener and setParams.


CoroutineCharacters

protected CoroutineCharacters(Listener<T> listener)

Construct instance that cannot be used until initialized by setParams.

Throws:
NullPointerException - if listener is null

CoroutineCharacters

protected CoroutineCharacters(Listener<T> listener,
                              CharSequence CharSequence)

Construct fully initialized instance, ready for immediate use.

Throws:
NullPointerException - if listener or charSequence is null
Method Detail

setListener

public void setListener(Listener<T> listener)

Set or reset the listener.

Throws:
NullPointerException - if elementListener is null

getListener

public Listener<T> getListener()

Get the listener.


setParams

public void setParams(CharSequence charSequence)

Set or reset data to be sent to the character handler.

Throws:
NullPointerException - if charSequence is null

run

public void run()

Execute a callback from the parser thread to run the character handler in the application thread. The parser is suspended until this method returns.

Specified by:
run in interface Runnable
Throws:
CoroutineTransferException - if the character handler throws an exception.

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