SilentEmitter emitter = new SilentEmitter();
@SuppressWarnings("deprecation")
Serializer serializer = new Serializer(emitter, resolver, dumperOptions,
dumperOptions.getExplicitRoot());
try {
serializer.open();
serializer.serialize(data);
serializer.close();
} catch (java.io.IOException e) {
throw new YAMLException(e);
}