GXPARSE hosted by SourceForge.net Logo

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

java.lang.Object
  extended by ca.gorman.xml.parse.toolkit.Coroutine_NoCallback<T>
      extended by ca.gorman.xml.parse.toolkit.Coroutine_Callback<T>
          extended by ca.gorman.xml.parse.toolkit.CoroutineCdata<T>
All Implemented Interfaces:
CurrentMarkedSection, MarkedSection, Runnable

public final class CoroutineCdata<T extends Parser>
extends Coroutine_Callback<T>
implements CurrentMarkedSection, Runnable

Invokes CDATA marked section handler from the parser thread to run in the application thread.


Constructor Summary
CoroutineCdata()
           Construct instance that cannot be used until initialized by setCoroutine setListener
CoroutineCdata(Coroutine coroutine)
           Construct instance that cannot be used until initialized by setListener
CoroutineCdata(Coroutine coroutine, Listener<T> listener)
           Construct fully initialized instance, ready for immediate use.
 
Method Summary
 Listener<T> getListener()
           Get the listener.
 void parseContent()
           Parse the content of a MarkedSection.
 void run()
           Execute a callback from the parser thread to run the CDATA marked section handler in the application thread.
 void setListener(Listener<T> listener)
           Set or reset the listener.
 
Methods inherited from class ca.gorman.xml.parse.toolkit.Coroutine_Callback
getCoroutine, setCoroutine
 
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

CoroutineCdata

public CoroutineCdata()

Construct instance that cannot be used until initialized by setCoroutine setListener


CoroutineCdata

public CoroutineCdata(Coroutine coroutine)

Construct instance that cannot be used until initialized by setListener

Throws:
NullPointerException - if coroutine is null

CoroutineCdata

public CoroutineCdata(Coroutine coroutine,
                      Listener<T> listener)

Construct fully initialized instance, ready for immediate use.

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

setListener

public void setListener(Listener<T> listener)

Set or reset the listener.

Throws:
NullPointerException - if listener is null

getListener

public Listener<T> getListener()

Get the listener.


run

public void run()

Execute a callback from the parser thread to run the CDATA marked section handler in the application thread. This method is invoked just before the parser starts parsing the CDATA marked section, and runs until the parser reaches the end of the CDATA marked section. The parser is suspended until the CDATA marked section handler invokes the parseContent method.

Specified by:
run in interface Runnable
Throws:
CoroutineTransferException - if the document handler throws a checked exception.

parseContent

public final void parseContent()
                        throws ListenerException,
                               IOException
Description copied from interface: CurrentMarkedSection

Parse the content of a MarkedSection.

This method causes the parser to continue operation, and does not return until the end of the marked section is reached. No part of the MarkedSection has been parsed before this method is invoked.

Specified by:
parseContent in interface CurrentMarkedSection
Throws:
ListenerException
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