当前位置: 首页>>代码示例>>Java>>正文


Java XMLStreamException.getMessage方法代码示例

本文整理汇总了Java中javax.xml.stream.XMLStreamException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java XMLStreamException.getMessage方法的具体用法?Java XMLStreamException.getMessage怎么用?Java XMLStreamException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.stream.XMLStreamException的用法示例。


在下文中一共展示了XMLStreamException.getMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readStAXSource

import javax.xml.stream.XMLStreamException; //导入方法依赖的package包/类
private Source readStAXSource(InputStream body) {
	try {
		XMLInputFactory inputFactory = XMLInputFactory.newFactory();
		inputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, isProcessExternalEntities());
		if (!isProcessExternalEntities()) {
			inputFactory.setXMLResolver(NO_OP_XML_RESOLVER);
		}
		XMLStreamReader streamReader = inputFactory.createXMLStreamReader(body);
		return new StAXSource(streamReader);
	}
	catch (XMLStreamException ex) {
		throw new HttpMessageNotReadableException("Could not parse document: " + ex.getMessage(), ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SourceHttpMessageConverter.java

示例2: dispose

import javax.xml.stream.XMLStreamException; //导入方法依赖的package包/类
@Override
public void dispose() {
    try {
        responseWriter.writeEndElement();
        responseWriter.writeCharacters(EOL);
        responseWriter.writeEndElement();
        responseWriter.writeCharacters(EOL);
        responseWriter.writeEndDocument();
        responseWriter.writeCharacters(EOL);
        responseWriter.flush();
        responseWriter.close();
        System.out.println("Gaze responses saved.");
    } catch (XMLStreamException e) {
        throw new RuntimeException("Log file footer could not be written: "
                + e.getMessage());
    }
    outFile = null;
}
 
开发者ID:SERESLab,项目名称:iTrace-Archive,代码行数:19,代码来源:XMLGazeExportSolver.java

示例3: parse

import javax.xml.stream.XMLStreamException; //导入方法依赖的package包/类
public void parse() throws SAXException {
    // parses from a StAX reader and generates SAX events which
    // go through the repeater and are forwarded to the appropriate
    // component
    try {
        reader.bridge();
    } catch( XMLStreamException e ) {
        // wrap it in a SAXException
        SAXParseException se =
            new SAXParseException2(
                e.getMessage(),
                null,
                null,
                e.getLocation() == null ? -1 : e.getLocation().getLineNumber(),
                e.getLocation() == null ? -1 : e.getLocation().getColumnNumber(),
                e);

        // if the consumer sets an error handler, it is our responsibility
        // to notify it.
        if(errorHandler!=null)
            errorHandler.fatalError(se);

        // this is a fatal error. Even if the error handler
        // returns, we will abort anyway.
        throw se;

    } finally {
        try {
            staxReader.close();
        } catch(XMLStreamException xe) {
            //falls through. Not much can be done.
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:StAXSource.java

示例4: next

import javax.xml.stream.XMLStreamException; //导入方法依赖的package包/类
public Object next() {
    Object object = null;
    try{
        object = nextEvent();
    }catch(XMLStreamException streamException){
        fLastEvent = null ;
        //don't swallow the cause
        NoSuchElementException e = new NoSuchElementException(streamException.getMessage());
        e.initCause(streamException.getCause());
        throw e;

    }
    return object;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:XMLEventReaderImpl.java


注:本文中的javax.xml.stream.XMLStreamException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。