Package com.esotericsoftware.yamlbeans.parser

Examples of com.esotericsoftware.yamlbeans.parser.DocumentStartEvent


    try {
      if (!started) {
        emitter.emit(Event.STREAM_START);
        started = true;
      }
      emitter.emit(new DocumentStartEvent(config.writeConfig.explicitFirstDocument, null, null));
      isRoot = true;
      writeValue(object, config.writeConfig.writeRootTags ? null : object.getClass(), null, null);
      emitter.emit(Event.DOCUMENT_END_FALSE);
    } catch (EmitterException ex) {
      throw new YamlException("Error writing YAML.", ex);
View Full Code Here


      }
    };
    table[S_FIRST_DOCUMENT_START] = new EmitterState() {
      public void expect () throws IOException {
        if (event.type == DOCUMENT_START) {
          DocumentStartEvent documentStartEvent = (DocumentStartEvent)event;
          if (documentStartEvent.version != null) {
            if (documentStartEvent.version.major != 1)
              throw new EmitterException("Unsupported YAML version: " + documentStartEvent.version);
            writer.writeVersionDirective(documentStartEvent.version.toString());
          }
View Full Code Here

    } else if (!indentless) indent += config.indentSize;
  }

  void expectDocumentStart (boolean first) throws IOException {
    if (event.type == DOCUMENT_START) {
      DocumentStartEvent ev = (DocumentStartEvent)event;
      boolean implicit = first && !ev.isExplicit && !config.canonical && ev.version == null && ev.tags == null
        && !checkEmptyDocument();
      if (!implicit) {
        writer.writeIndent(indent);
        writer.writeIndicator("--- ", true, true, false);
View Full Code Here

    try {
      if (!started) {
        emitter.emit(Event.STREAM_START);
        started = true;
      }
      emitter.emit(new DocumentStartEvent(config.writeConfig.explicitFirstDocument, null, null));
      isRoot = true;
      writeValue(object, config.writeConfig.writeRootTags ? null : object.getClass(), null, null);
      emitter.emit(new DocumentEndEvent(config.writeConfig.explicitEndDocument));
    } catch (EmitterException ex) {
      throw new YamlException("Error writing YAML.", ex);
View Full Code Here

      }
    };
    table[S_FIRST_DOCUMENT_START] = new EmitterState() {
      public void expect () throws IOException {
        if (event.type == DOCUMENT_START) {
          DocumentStartEvent documentStartEvent = (DocumentStartEvent)event;
          if (documentStartEvent.version != null) {
            if (documentStartEvent.version.major != 1)
              throw new EmitterException("Unsupported YAML version: " + documentStartEvent.version);
            writer.writeVersionDirective(documentStartEvent.version.toString());
          }
View Full Code Here

    } else if (!indentless) indent += config.indentSize;
  }

  void expectDocumentStart (boolean first) throws IOException {
    if (event.type == DOCUMENT_START) {
      DocumentStartEvent ev = (DocumentStartEvent)event;
      boolean implicit = first && !ev.isExplicit && !config.canonical && ev.version == null && ev.tags == null
        && !checkEmptyDocument();
      if (!implicit) {
        writer.writeIndent(indent);
        writer.writeIndicator("--- ", true, true, false);
View Full Code Here

TOP

Related Classes of com.esotericsoftware.yamlbeans.parser.DocumentStartEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.