org.yaml.snakeyaml
Class JavaBeanDumper

java.lang.Object
  extended by org.yaml.snakeyaml.JavaBeanDumper

public class JavaBeanDumper
extends Object

Convenience utility to serialize JavaBeans.


Constructor Summary
JavaBeanDumper()
          Create Dumper for JavaBeans.
JavaBeanDumper(boolean useGlobalTag)
          Create Dumper for JavaBeans
 
Method Summary
 String dump(Object data)
          Serialize JavaBean
 void dump(Object data, Writer output)
          Serialize JavaBean
 DumperOptions.FlowStyle getFlowStyle()
           
 boolean isUseGlobalTag()
           
 void setFlowStyle(DumperOptions.FlowStyle flowStyle)
           
 void setMapTagForBean(Class<? extends Object> clazz)
          Skip global tag with the specified class in a type-safe collection
 void setUseGlobalTag(boolean useGlobalTag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBeanDumper

public JavaBeanDumper(boolean useGlobalTag)
Create Dumper for JavaBeans

Parameters:
useGlobalTag - true to emit the global tag with the class name

JavaBeanDumper

public JavaBeanDumper()
Create Dumper for JavaBeans. Use "tag:yaml.org,2002:map" as the root tag.

Method Detail

dump

public void dump(Object data,
                 Writer output)
Serialize JavaBean

Parameters:
data - JavaBean instance to serialize
output - destination

dump

public String dump(Object data)
Serialize JavaBean

Parameters:
data - JavaBean instance to serialize
Returns:
serialized YAML document

isUseGlobalTag

public boolean isUseGlobalTag()

setUseGlobalTag

public void setUseGlobalTag(boolean useGlobalTag)

getFlowStyle

public DumperOptions.FlowStyle getFlowStyle()

setFlowStyle

public void setFlowStyle(DumperOptions.FlowStyle flowStyle)

setMapTagForBean

public void setMapTagForBean(Class<? extends Object> clazz)
Skip global tag with the specified class in a type-safe collection

Parameters:
clazz - JavaBean Class to represent as Map


Copyright © 2008-2009. All Rights Reserved.