Created
August 15, 2008 13:23
-
-
Save shenie/5570 to your computer and use it in GitHub Desktop.
yaml dumper using jyaml lib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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