public void expect() throws IOException { if (event instanceof StreamStartEvent) { writeStreamStart(); state = new ExpectFirstDocumentStart(); } else { throw new EmitterException("expected StreamStartEvent, but got " + event); } } }
private void expectBlockSequence() throws IOException { boolean indentless = mappingContext && !indention; increaseIndent(false, indentless); state = new ExpectFirstBlockSequenceItem(); }
private void expectFlowMapping() throws IOException { writeIndicator("{", true, true, false); flowLevel++; increaseIndent(true, false); if (prettyFlow) { writeIndent(); } state = new ExpectFirstFlowMappingKey(); }
public void expect() throws IOException { if (event instanceof DocumentEndEvent) { writeIndent(); if (((DocumentEndEvent) event).getExplicit()) { writeIndicator("...", true, false, false); writeIndent(); } flushStream(); state = new ExpectDocumentStart(false); } else { throw new EmitterException("expected DocumentEndEvent, but got " + event); } } }
private void expectFlowSequence() throws IOException { writeIndicator("[", true, true, false); flowLevel++; increaseIndent(true, false); if (prettyFlow) { writeIndent(); } state = new ExpectFirstFlowSequenceItem(); }
public void expect() throws IOException { if (!this.first && event instanceof MappingEndEvent) { indent = indents.pop(); state = states.pop(); } else { writeIndent(); if (checkSimpleKey()) { states.push(new ExpectBlockMappingSimpleValue()); expectNode(false, true, true); } else { writeIndicator("?", true, false, true); states.push(new ExpectBlockMappingValue()); expectNode(false, true, false); } } } }
public void expect() throws IOException { if (canonical || (column > bestWidth) || prettyFlow) { writeIndent(); } writeIndicator(":", true, false, false); states.push(new ExpectFlowMappingKey()); expectNode(false, true, false); } }
public void expect() throws IOException { writeIndent(); writeIndicator(":", true, false, true); states.push(new ExpectBlockMappingKey(false)); expectNode(false, true, false); } }
public void expect() throws IOException { if (!this.first && event instanceof SequenceEndEvent) { indent = indents.pop(); state = states.pop(); } else { writeIndent(); writeWhitespace(indicatorIndent); writeIndicator("-", true, false, true); states.push(new ExpectBlockSequenceItem(false)); expectNode(false, false, false); } } }
private void expectBlockMapping() throws IOException { increaseIndent(false, false); state = new ExpectFirstBlockMappingKey(); }
public void expect() throws IOException { new ExpectBlockMappingKey(true).expect(); } }
public void expect() throws IOException { new ExpectDocumentStart(true).expect(); } }
public void expect() throws IOException { new ExpectBlockSequenceItem(true).expect(); } }
public void emit(Event event) throws IOException { this.events.add(event); while (!needMoreEvents()) { this.event = this.events.poll(); this.state.expect(); this.event = null; } }
public void expect() throws IOException { writeIndicator(":", false, false, false); states.push(new ExpectBlockMappingKey(false)); expectNode(false, true, false); } }
public void expect() throws IOException { writeIndicator(":", false, false, false); states.push(new ExpectFlowMappingKey()); expectNode(false, true, false); } }
void writeIndent() throws IOException { int indent; if (this.indent != null) { indent = this.indent; } else { indent = 0; } if (!this.indention || this.column > indent || (this.column == indent && !this.whitespace)) { writeLineBreak(null); } writeWhitespace(indent - this.column); }
private void expectAlias() throws IOException { if (((NodeEvent) event).getAnchor() == null) { throw new EmitterException("anchor is not specified for alias"); } processAnchor("*"); state = states.pop(); }
public void expect() throws IOException { throw new EmitterException("expecting nothing, but got " + event); } }
void writeStreamEnd() throws IOException { flushStream(); }