Search in sources :

Example 1 with ConsoleErrorReporter

use of com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter in project metro-jax-ws by eclipse-ee4j.

the class WSDLParserTest method createErrorReceiver.

private static ErrorReceiverFilter createErrorReceiver() {
    class Listener extends WsimportListener {

        ConsoleErrorReporter cer = new ConsoleErrorReporter(System.err);

        @Override
        public void generatedFile(String fileName) {
            message(fileName);
        }

        @Override
        public void message(String msg) {
            System.out.println(msg);
        }

        @Override
        public void error(SAXParseException exception) {
            cer.error(exception);
        }

        @Override
        public void fatalError(SAXParseException exception) {
            cer.fatalError(exception);
        }

        @Override
        public void warning(SAXParseException exception) {
            cer.warning(exception);
        }

        @Override
        public void debug(SAXParseException exception) {
            cer.debug(exception);
        }

        @Override
        public void info(SAXParseException exception) {
            cer.info(exception);
        }

        public void enableDebugging() {
            cer.enableDebugging();
        }
    }
    final Listener listener = new Listener();
    ErrorReceiverFilter errorReceiver = new ErrorReceiverFilter(listener) {

        public void info(SAXParseException exception) {
            super.info(exception);
        }

        public void warning(SAXParseException exception) {
            super.warning(exception);
        }

        @Override
        public void pollAbort() throws AbortException {
            if (listener.isCanceled()) {
                throw new AbortException();
            }
        }

        @Override
        public void debug(SAXParseException exception) {
            listener.debug(exception);
        }
    };
    return errorReceiver;
}
Also used : WsimportListener(com.sun.tools.ws.wscompile.WsimportListener) WsimportListener(com.sun.tools.ws.wscompile.WsimportListener) ErrorReceiverFilter(com.sun.tools.ws.wscompile.ErrorReceiverFilter) SAXParseException(org.xml.sax.SAXParseException) ConsoleErrorReporter(com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter) AbortException(com.sun.tools.ws.wscompile.AbortException)

Aggregations

ConsoleErrorReporter (com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter)1 AbortException (com.sun.tools.ws.wscompile.AbortException)1 ErrorReceiverFilter (com.sun.tools.ws.wscompile.ErrorReceiverFilter)1 WsimportListener (com.sun.tools.ws.wscompile.WsimportListener)1 SAXParseException (org.xml.sax.SAXParseException)1