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


Java Event.getStartMark方法代码示例

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


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

示例1: getSingleNode

import org.yaml.snakeyaml.events.Event; //导入方法依赖的package包/类
/**
 * Reads a document from a source that contains only one document.
 * <p>
 * If the stream contains more than one document an exception is thrown.
 * </p>
 * 
 * @return The root node of the document or <code>null</code> if no document
 *         is available.
 */
public Node getSingleNode() {
    // Drop the STREAM-START event.
    parser.getEvent();
    // Compose a document if the stream is not empty.
    Node document = null;
    if (!parser.checkEvent(Event.ID.StreamEnd)) {
        document = composeDocument();
    }
    // Ensure that the stream contains no more documents.
    if (!parser.checkEvent(Event.ID.StreamEnd)) {
        Event event = parser.getEvent();
        throw new ComposerException("expected a single document in the stream",
                document.getStartMark(), "but found another document", event.getStartMark());
    }
    // Drop the STREAM-END event.
    parser.getEvent();
    return document;
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:28,代码来源:Composer.java

示例2: getSingleNode

import org.yaml.snakeyaml.events.Event; //导入方法依赖的package包/类
/**
 * Reads a document from a source that contains only one document.
 * <p>
 * If the stream contains more than one document an exception is thrown.
 * </p>
 *
 * @return The root node of the document or <code>null</code> if no document
 *         is available.
 */
public Node getSingleNode() {
    // Drop the STREAM-START event.
    parser.getEvent();
    // Compose a document if the stream is not empty.
    Node document = null;
    if (!parser.checkEvent(Event.ID.StreamEnd)) {
        document = composeDocument();
    }
    // Ensure that the stream contains no more documents.
    if (!parser.checkEvent(Event.ID.StreamEnd)) {
        Event event = parser.getEvent();
        throw new ComposerException("expected a single document in the stream",
                document.getStartMark(), "but found another document", event.getStartMark());
    }
    // Drop the STREAM-END event.
    parser.getEvent();
    return document;
}
 
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:28,代码来源:Composer.java


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