org.xml.sax.SAXParseException#getCause ( )源码实例Demo

下面列出了org.xml.sax.SAXParseException#getCause ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: birt   文件: ErrorDetail.java
/**
 * 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( ) );
	}
}
 
源代码2 项目: TencentKona-8   文件: ConsoleErrorReporter.java
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);
    }
}
 
源代码3 项目: jdk8u60   文件: ConsoleErrorReporter.java
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);
    }
}
 
源代码4 项目: openjdk-jdk8u   文件: ConsoleErrorReporter.java
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);
    }
}
 
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);
    }
}
 
源代码6 项目: openjdk-jdk9   文件: ConsoleErrorReporter.java
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);
    }
}
 
源代码7 项目: hottub   文件: ConsoleErrorReporter.java
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);
    }
}
 
源代码8 项目: openjdk-8-source   文件: ConsoleErrorReporter.java
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);
    }
}
 
源代码9 项目: openjdk-8   文件: ConsoleErrorReporter.java
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);
    }
}
 
源代码10 项目: windup   文件: ValidateXmlFilesRuleProvider.java
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);
}