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;
}
Aggregations