private void co_yield ( boolean moreRemains ) throws SAXException { // Horrendous kluge to run filter to completion. See below. if ( fNoMoreEvents ) return ; try // Coroutine manager might throw no-such. { Object arg = Boolean . FALSE ; if ( moreRemains ) { // Yield control, resume parsing when done arg = fCoroutineManager . co_resume ( Boolean . TRUE , fSourceCoroutineID , fControllerCoroutineID ) ; } // If we're at end of document or were told to stop early if ( arg == Boolean . FALSE ) { fNoMoreEvents = true ; if ( fXMLReader != null ) // Running under startParseThread() throw new StopException ( ) ; // We'll co_exit from there. // Yield control. We do NOT expect anyone to ever ask us again. fCoroutineManager . co_exit_to ( Boolean . FALSE , fSourceCoroutineID , fControllerCoroutineID ) ; } } catch ( NoSuchMethodException e ) { // Shouldn't happen unless we've miscoded our coroutine logic // "Shut down the garbage smashers on the detention level!" fNoMoreEvents = true ; fCoroutineManager . co_exit ( fSourceCoroutineID ) ; throw new SAXException ( e ) ; } }
Co_Yield handles coroutine interactions while a parse is in progress .