SAX2StAXEventWriter.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:OpenJSharp 作者:
public void comment(char[] ch, int start, int length) throws SAXException {
    if (needToCallStartDocument) {
        // Drat. We were trying to postpone this until the first element so that we could get
        // the locator, but we can't output a comment before the start document, so we're just
        // going to have to do without the locator if it hasn't been set yet.
        writeStartDocument();
    }

    super.comment(ch, start, length);

    eventFactory.setLocation(getCurrentLocation());
    try {

        writer.add(eventFactory.createComment(new String(ch, start,
                length)));

    } catch (XMLStreamException e) {

        throw new SAXException(e);

    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号