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