net.sourceforge.yamlbeans
Class YamlConfig.WriteConfig

java.lang.Object
  extended by net.sourceforge.yamlbeans.YamlConfig.WriteConfig
Enclosing class:
YamlConfig

public static class YamlConfig.WriteConfig
extends java.lang.Object


Method Summary
 void setAlwaysWriteClassname(boolean write)
          If true, class name tags will always be output.
 void setAutoAnchor(boolean autoAnchor)
          If true, values that are referenced multiple times will use an anchor.
 void setCanonical(boolean canonical)
          If true, the YAML output will be canonical.
 void setEscapeUnicode(boolean escapeUnicode)
          If false, unicode characters will be output instead of the escaped unicode character code.
 void setExplicitFirstDocument(boolean explicitFirstDocument)
          If true, the first document will have a document start token (---).
 void setIndentSize(int indentSize)
          Sets the number of spaces to indent.
 void setUseVerbatimTags(boolean useVerbatimTags)
          If false, tags will never be surrounded by angle brackets (eg, "!").
 void setVersion(Version version)
          Sets the YAML version to output.
 void setWrapColumn(int wrapColumn)
          Sets the column at which values will attempt to wrap.
 void setWriteDefaultValues(boolean writeDefaultValues)
          If false, object fields with default values will not be written.
 void setWriteRootElementTags(boolean writeRootElementTags)
          If true, the elements of a Collection or Map root for each YAML document will have a tag defining the class that was written, if necessary.
 void setWriteRootTags(boolean writeRootTags)
          If true, the root of each YAML document will have a tag defining the class that was written, if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setExplicitFirstDocument

public void setExplicitFirstDocument(boolean explicitFirstDocument)
If true, the first document will have a document start token (---). Default is false.


setWriteRootTags

public void setWriteRootTags(boolean writeRootTags)
If true, the root of each YAML document will have a tag defining the class that was written, if necessary. Tags are not necessary for primitive types, Strings, ArrayList, or HashMap. It is useful to set this to false when planning to read the object with the YamlReader.read(Class) method. Default is true.


setWriteRootElementTags

public void setWriteRootElementTags(boolean writeRootElementTags)
If true, the elements of a Collection or Map root for each YAML document will have a tag defining the class that was written, if necessary. Tags are not necessary for primitive types, Strings, ArrayList, or HashMap. It is useful to set this to false when planning to read the object with the YamlReader.read(Class, Class) method. Default is true.


setWriteDefaultValues

public void setWriteDefaultValues(boolean writeDefaultValues)
If false, object fields with default values will not be written. A prototype object is created to determine the default value for each field on the object. Default is false.


setAutoAnchor

public void setAutoAnchor(boolean autoAnchor)
If true, values that are referenced multiple times will use an anchor. This works across YAML documents (ie multiple calls to YamlWriter.write(Object)). When true, objects are not actually written until YamlWriter.clearAnchors() or YamlWriter.close() is called. If changing auto anchor to false, YamlWriter.clearAnchors() should be called first to output any buffered objects. Default is true.


setVersion

public void setVersion(Version version)
Sets the YAML version to output. Default is 1.1.


setCanonical

public void setCanonical(boolean canonical)
If true, the YAML output will be canonical. Default is false.


setIndentSize

public void setIndentSize(int indentSize)
Sets the number of spaces to indent. Default is 3.


setWrapColumn

public void setWrapColumn(int wrapColumn)
Sets the column at which values will attempt to wrap. Default is 100.


setUseVerbatimTags

public void setUseVerbatimTags(boolean useVerbatimTags)
If false, tags will never be surrounded by angle brackets (eg, "!"). Default is false.


setEscapeUnicode

public void setEscapeUnicode(boolean escapeUnicode)
If false, unicode characters will be output instead of the escaped unicode character code.


setAlwaysWriteClassname

public void setAlwaysWriteClassname(boolean write)
If true, class name tags will always be output.