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;
}