Skip to content

Instantly share code, notes, and snippets.

@shenie
Created August 15, 2008 13:23
Show Gist options
  • Save shenie/5570 to your computer and use it in GitHub Desktop.
Save shenie/5570 to your computer and use it in GitHub Desktop.
yaml dumper using jyaml lib
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.log4j.Logger;
import org.ho.yaml.Yaml;
public class YamlDumper {
private static final Logger LOG = Logger.getLogger(YamlDumper.class);
private final Object object;
public YamlDumper(Object object) {
this.object = object;
}
public String dump() {
ByteArrayOutputStream output = new ByteArrayOutputStream();
Yaml.dump(object, output);
String str = output.toString();
LOG.info(str);
return str;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment