FreeColXMLReader.java 文件源码

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

项目:freecol 作者:
/**
 * Close the current tag, but accept some alternative elements first.
 *
 * @param tag The expected tag to close.
 * @param others Alternate elements to accept.
 * @exception XMLStreamException if a closing tag is not found.
 */
public void closeTag(String tag, String... others) throws XMLStreamException {
    for (int next = nextTag(); next != XMLStreamConstants.END_ELEMENT;
         next = nextTag()) {
        String at = find(others, s -> atTag(s));
        if (at == null) {
            throw new XMLStreamException("Parse error, END_ELEMENT(" + tag
                + " or alternatives) expected, not: " + getLocalName());
        }
        closeTag(at);
    }
    expectTag(tag);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号