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


Java DumperOptions.getWidth方法代码示例

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


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

示例1: Emitter

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
public Emitter(Writer stream, DumperOptions opts) {
    // The stream should have the methods `write` and possibly `flush`.
    this.stream = stream;
    // Emitter is a state machine with a stack of states to handle nested
    // structures.
    this.states = new ArrayStack<EmitterState>(100);
    this.state = new ExpectStreamStart();
    // Current event and the event queue.
    this.events = new ArrayBlockingQueue<Event>(100);
    this.event = null;
    // The current indentation level and the stack of previous indents.
    this.indents = new ArrayStack<Integer>(10);
    this.indent = null;
    // Flow level.
    this.flowLevel = 0;
    // Contexts.
    mappingContext = false;
    simpleKeyContext = false;

    //
    // Characteristics of the last emitted character:
    // - current position.
    // - is it a whitespace?
    // - is it an indention character
    // (indentation space, '-', '?', or ':')?
    column = 0;
    whitespace = true;
    indention = true;

    // Whether the document requires an explicit document indicator
    openEnded = false;

    // Formatting details.
    this.canonical = opts.isCanonical();
    this.prettyFlow = opts.isPrettyFlow();
    this.allowUnicode = opts.isAllowUnicode();
    this.bestIndent = 2;
    if ((opts.getIndent() > MIN_INDENT) && (opts.getIndent() < MAX_INDENT)) {
        this.bestIndent = opts.getIndent();
    }
    this.indicatorIndent = opts.getIndicatorIndent();
    this.bestWidth = 80;
    if (opts.getWidth() > this.bestIndent * 2) {
        this.bestWidth = opts.getWidth();
    }
    this.bestLineBreak = opts.getLineBreak().getString().toCharArray();
    this.splitLines = opts.getSplitLines();

    // Tag prefixes.
    this.tagPrefixes = new LinkedHashMap<String, String>();

    // Prepared anchor and tag.
    this.preparedAnchor = null;
    this.preparedTag = null;

    // Scalar analysis and style.
    this.analysis = null;
    this.style = null;
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:60,代码来源:Emitter.java


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