You can do it the same way you'd halt parsing in a normal SAX parser - create a subclass of SAXException
(ie, something like HaltProcessingException
) and then throw it whenever you are done processing - for example, after sCutOff = lastVal;
.
Then your code that invokes that handler (probably something like parser.parse()
) should catch that specific exception and log that you've finished processing and suppress the exception.