blob: 42ab2f57efa6a9288ec095e312edb7b34432ab48 [file] [edit]
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018-2023 Saxonica Limited
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
package net.sf.saxon.trans;
/**
* An exception used to signal that no more input is required from the parser, and that
* parsing can therefore be abandoned early (but without signaling any error to the user)
*/
public class QuitParsingException extends XPathException {
private boolean notifiedByConsumer = false;
/**
* Create a QuitParsingException
*
* @param notifiedByConsumer should be set to true if the exception was generating in the parsing
* thread in response to an interrupt from the consuming thread; in this case
* there is no need for the consuming thread to be notified of the termination
* (by sending a "stopper" item); and indeed, doing so causes the thread to hang.
* See bug 3080.
*/
public QuitParsingException(boolean notifiedByConsumer) {
super("The input file has not been read to completion", "SXQP0001");
this.notifiedByConsumer = notifiedByConsumer;
}
public boolean isNotifiedByConsumer() {
return notifiedByConsumer;
}
}