org.yaml.snakeyaml
Class DumperOptions

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

public class DumperOptions
extends Object

See Also:
PyYAML for more information

Nested Class Summary
static class DumperOptions.FlowStyle
          Block styles use indentation to denote nesting and scope within the document.
static class DumperOptions.LineBreak
          Platform dependent line break.
static class DumperOptions.ScalarStyle
          YAML provides a rich set of scalar styles.
static class DumperOptions.Version
          Specification version.
 
Constructor Summary
DumperOptions()
           
 
Method Summary
 DumperOptions.FlowStyle getDefaultFlowStyle()
           
 DumperOptions.ScalarStyle getDefaultScalarStyle()
           
 String getExplicitRoot()
           
 int getIndent()
           
 DumperOptions.LineBreak getLineBreak()
           
 Map<String,String> getTags()
           
 DumperOptions.Version getVersion()
           
 int getWidth()
           
 boolean isAllowUnicode()
           
 boolean isCanonical()
           
 boolean isExplicitEnd()
           
 boolean isExplicitStart()
           
 void setAllowUnicode(boolean allowUnicode)
          Specify whether to emit non-ASCII printable Unicode characters (to support ASCII terminals).
 void setCanonical(boolean canonical)
          Force the emitter to produce a canonical YAML document.
 void setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle)
           
 void setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
          Set default style for scalars.
 void setExplicitEnd(boolean explicitEnd)
           
 void setExplicitRoot(String expRoot)
           
 void setExplicitStart(boolean explicitStart)
           
 void setIndent(int indent)
           
 void setLineBreak(DumperOptions.LineBreak lineBreak)
          Specify the line break to separate the lines.
 void setTags(Map<String,String> tags)
           
 void setVersion(DumperOptions.Version version)
           
 void setWidth(int bestWidth)
          Specify the preferred width to emit scalars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DumperOptions

public DumperOptions()
Method Detail

isAllowUnicode

public boolean isAllowUnicode()

setAllowUnicode

public void setAllowUnicode(boolean allowUnicode)
Specify whether to emit non-ASCII printable Unicode characters (to support ASCII terminals). The default value is true.

Parameters:
allowUnicode - if allowUnicode is false then all non-ASCII characters are escaped

getDefaultScalarStyle

public DumperOptions.ScalarStyle getDefaultScalarStyle()

setDefaultScalarStyle

public void setDefaultScalarStyle(DumperOptions.ScalarStyle defaultStyle)
Set default style for scalars. See YAML 1.1 specification, 2.3 Scalars (http://yaml.org/spec/1.1/#id858081)

Parameters:
defaultStyle - set the style for all scalars

setIndent

public void setIndent(int indent)

getIndent

public int getIndent()

setVersion

public void setVersion(DumperOptions.Version version)

getVersion

public DumperOptions.Version getVersion()

setCanonical

public void setCanonical(boolean canonical)
Force the emitter to produce a canonical YAML document.

Parameters:
canonical - true produce canonical YAML document

isCanonical

public boolean isCanonical()

setWidth

public void setWidth(int bestWidth)
Specify the preferred width to emit scalars. When the scalar representation takes more then the preferred with the scalar will be split into a few lines. The default is 80.

Parameters:
bestWidth - the preferred with for scalars.

getWidth

public int getWidth()

getLineBreak

public DumperOptions.LineBreak getLineBreak()

setDefaultFlowStyle

public void setDefaultFlowStyle(DumperOptions.FlowStyle defaultFlowStyle)

getDefaultFlowStyle

public DumperOptions.FlowStyle getDefaultFlowStyle()

getExplicitRoot

public String getExplicitRoot()

setExplicitRoot

public void setExplicitRoot(String expRoot)
Parameters:
expRoot - tag to be used for the root node. (JavaBeans may use Tags.MAP="tag:yaml.org,2002:map")

setLineBreak

public void setLineBreak(DumperOptions.LineBreak lineBreak)
Specify the line break to separate the lines. It is platform specific: Windows - "\r\n", MacOS - "\r", Linux - "\n". The default value is the one for Linux.


isExplicitStart

public boolean isExplicitStart()

setExplicitStart

public void setExplicitStart(boolean explicitStart)

isExplicitEnd

public boolean isExplicitEnd()

setExplicitEnd

public void setExplicitEnd(boolean explicitEnd)

getTags

public Map<String,String> getTags()

setTags

public void setTags(Map<String,String> tags)


Copyright © 2008-2009. All Rights Reserved.