GXPARSE hosted by SourceForge.net Logo

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

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

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

Invokes element declaration handler from the parser thread to run in the application thread.


Constructor Summary
CoroutineElementDecl()
           Construct instance that cannot be used until initialized by setListener and setParams.
CoroutineElementDecl(DtdListener<T> listener)
           Construct instance that cannot be used until initialized by setParams.
CoroutineElementDecl(DtdListener<T> listener, String name, String model)
           Construct fully initialized instance, ready for immediate use.
 
Method Summary
 DtdListener<T> getListener()
           Get the listener.
 void run()
           Execute a callback from the parser thread to run the element declaration handler in the application thread.
 void setListener(DtdListener<T> listener)
           Set or reset the listener.
 void setParams(String name, String model)
           Set or reset data to be sent to the element declaration 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

CoroutineElementDecl

public CoroutineElementDecl()

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


CoroutineElementDecl

public CoroutineElementDecl(DtdListener<T> listener)

Construct instance that cannot be used until initialized by setParams.

Throws:
NullPointerException - if listener is null

CoroutineElementDecl

public CoroutineElementDecl(DtdListener<T> listener,
                            String name,
                            String model)

Construct fully initialized instance, ready for immediate use.

Throws:
NullPointerException - if listener is null
Method Detail

setListener

public void setListener(DtdListener<T> listener)

Set or reset the listener.

Throws:
NullPointerException - if listener is null

getListener

public DtdListener<T> getListener()

Get the listener.


setParams

public void setParams(String name,
                      String model)

Set or reset data to be sent to the element declaration handler.


run

public void run()

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

Specified by:
run in interface Runnable
Throws:
CoroutineTransferException - if the element declaration 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