Java Code Examples for org.xml.sax.SAXParseException#getCause()
The following examples show how to use
org.xml.sax.SAXParseException#getCause() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ErrorDetail.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * Translates <code>SAXParseException</code>. * * @param e * exception to translate */ private void translate( SAXParseException e ) { type = DesignFileException.DESIGN_EXCEPTION_INVALID_XML; exceptionName = e.getClass( ).getName( ); message = e.getMessage( ); description.append( " ( line = " ); //$NON-NLS-1$ description.append( e.getLineNumber( ) ); description.append( ") " ); //$NON-NLS-1$ description.append( e.getClass( ).getName( ) ); description.append( " (" ); //$NON-NLS-1$ description.append( "message : " ); //$NON-NLS-1$ description.append( e.getMessage( ) ); description.append( ")" ); //$NON-NLS-1$ lineNo = e.getLineNumber( ); if ( e.getCause( ) != null && e.getCause( ) instanceof RuntimeException ) { translateCausedException( e.getCause( ) ); } }
Example 2
Source File: ConsoleErrorReporter.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 3
Source File: ConsoleErrorReporter.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 4
Source File: ConsoleErrorReporter.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 5
Source File: ConsoleErrorReporter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 6
Source File: ConsoleErrorReporter.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 7
Source File: ConsoleErrorReporter.java From hottub with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 8
Source File: ConsoleErrorReporter.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 9
Source File: ConsoleErrorReporter.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void error(SAXParseException e) { if(debug) e.printStackTrace(); hasError = true; if((e.getSystemId() == null && e.getPublicId() == null) && (e.getCause() instanceof UnknownHostException)) { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.toString()), e); } else { print(WscompileMessages.WSIMPORT_ERROR_MESSAGE(e.getMessage()), e); } }
Example 10
Source File: ValidateXmlFilesRuleProvider.java From windup with Eclipse Public License 1.0 | 5 votes |
private void createSAXParseHint(GraphRewrite event, EvaluationContext context, XmlFileModel sourceFile, SAXParseException e) { int lineNumber = e.getLineNumber(); int column = e.getColumnNumber(); InlineHintService service = new InlineHintService(event.getGraphContext()); InlineHintModel hintModel = service.create(); hintModel.setRuleID(((Rule) context.get(Rule.class)).getId()); hintModel.setLineNumber(lineNumber); hintModel.setColumnNumber(column); // FIXME - Fake value as we don't get an actual length of the error from the parser hintModel.setLength(1); hintModel.setFile(sourceFile); hintModel.setEffort(1); IssueCategoryRegistry issueCategoryRegistry = IssueCategoryRegistry.instance(event.getRewriteContext()); hintModel.setIssueCategory(issueCategoryRegistry.loadFromGraph(event.getGraphContext(), IssueCategoryRegistry.POTENTIAL)); if (e.getCause() instanceof InvalidXSDURLException) { String xsdUrl = ((InvalidXSDURLException) e.getCause()).getUrl(); hintModel.setTitle(XmlFileModel.XSD_URL_NOT_VALID); hintModel.setHint(xsdUrl + " is not a valid url."); } else { hintModel.setTitle(XmlFileModel.NOT_VALID_XML); String message = "XSD Validation failed due to:\n\n"; message += "\t" + e.getMessage(); message += System.lineSeparator()+System.lineSeparator(); hintModel.setHint(message); } sourceFile.setGenerateSourceReport(true); }