本文整理匯總了Java中org.yaml.snakeyaml.DumperOptions.isCanonical方法的典型用法代碼示例。如果您正苦於以下問題:Java DumperOptions.isCanonical方法的具體用法?Java DumperOptions.isCanonical怎麽用?Java DumperOptions.isCanonical使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.yaml.snakeyaml.DumperOptions
的用法示例。
在下文中一共展示了DumperOptions.isCanonical方法的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;
}