Package com.esotericsoftware.yamlbeans.parser

Examples of com.esotericsoftware.yamlbeans.parser.SequenceStartEvent


        return;
      }
    }

    if (object instanceof Collection) {
      emitter.emit(new SequenceStartEvent(anchor, tag, !showTag, false));
      for (Object item : (Collection)object) {
        if (isRoot && !config.writeConfig.writeRootElementTags) elementType = item.getClass();
        writeValue(item, elementType, null, null);
      }
      emitter.emit(Event.SEQUENCE_END);
      return;
    }

    if (object instanceof Map) {
      emitter.emit(new MappingStartEvent(anchor, tag, !showTag, false));
      for (Object item : ((Map)object).entrySet()) {
        Entry entry = (Entry)item;
        writeValue(entry.getKey(), null, null, null);
        if (isRoot && !config.writeConfig.writeRootElementTags) elementType = entry.getValue().getClass();
        writeValue(entry.getValue(), elementType, null, null);
      }
      emitter.emit(Event.MAPPING_END);
      return;
    }

    if (fieldClass.isArray()) {
      elementType = fieldClass.getComponentType();
      emitter.emit(new SequenceStartEvent(anchor, null, true, false));
      for (int i = 0, n = Array.getLength(object); i < n; i++)
        writeValue(Array.get(object, i), elementType, null, null);
      emitter.emit(Event.SEQUENCE_END);
      return;
    }
View Full Code Here


      emitter.emit(new ScalarEvent(null, null, new boolean[] {true, true}, String.valueOf(object), (char)0));
      return;
    }

    if (object instanceof Collection) {
      emitter.emit(new SequenceStartEvent(anchor, tag, !showTag, false));
      for (Object item : (Collection)object) {
        if (isRoot && !config.writeConfig.writeRootElementTags) elementType = item.getClass();
        writeValue(item, elementType, null, null);
      }
      emitter.emit(Event.SEQUENCE_END);
      return;
    }

    if (object instanceof Map) {
      emitter.emit(new MappingStartEvent(anchor, tag, !showTag, false));
      for (Object item : ((Map)object).entrySet()) {
        Entry entry = (Entry)item;
        writeValue(entry.getKey(), null, null, null);
        if (isRoot && !config.writeConfig.writeRootElementTags) elementType = entry.getValue().getClass();
        writeValue(entry.getValue(), elementType, null, null);
      }
      emitter.emit(Event.MAPPING_END);
      return;
    }

    if (fieldClass.isArray()) {
      elementType = fieldClass.getComponentType();
      emitter.emit(new SequenceStartEvent(anchor, null, true, false));
      for (int i = 0, n = Array.getLength(object); i < n; i++)
        writeValue(Array.get(object, i), elementType, null, null);
      emitter.emit(Event.SEQUENCE_END);
      return;
    }
View Full Code Here

TOP

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

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.