Class DumperOptions


  • public class DumperOptions
    extends Object
    • 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. The default value is true. When set to false then printable non-ASCII characters (Cyrillic, Chinese etc) will be not printed but escaped (to support ASCII terminals)
        Parameters:
        allowUnicode - if allowUnicode is false then all non-ASCII characters are escaped
      • 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()
      • setIndicatorIndent

        public void setIndicatorIndent​(int indicatorIndent)
      • getIndicatorIndent

        public int getIndicatorIndent()
      • 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()
      • setPrettyFlow

        public void setPrettyFlow​(boolean prettyFlow)
        Force the emitter to produce a pretty YAML document when using the flow style.
        Parameters:
        prettyFlow - true produce pretty flow YAML document
      • isPrettyFlow

        public boolean isPrettyFlow()
      • 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 width for scalars.
      • getWidth

        public int getWidth()
      • setSplitLines

        public void setSplitLines​(boolean splitLines)
        Specify whether to split lines exceeding preferred width for scalars. The default is true.
        Parameters:
        splitLines - whether to split lines exceeding preferred width for scalars.
      • getSplitLines

        public boolean getSplitLines()
      • setLineBreak

        public void setLineBreak​(DumperOptions.LineBreak lineBreak)
        Specify the line break to separate the lines. It is platform specific: Windows - "\r\n", old MacOS - "\r", Unix - "\n". The default value is the one for Unix.
        Parameters:
        lineBreak - to be used for the input
      • isExplicitStart

        public boolean isExplicitStart()
      • setExplicitStart

        public void setExplicitStart​(boolean explicitStart)
      • isExplicitEnd

        public boolean isExplicitEnd()
      • setExplicitEnd

        public void setExplicitEnd​(boolean explicitEnd)
      • isAllowReadOnlyProperties

        public boolean isAllowReadOnlyProperties()
        Report whether read-only JavaBean properties (the ones without setters) should be included in the YAML document
        Returns:
        false when read-only JavaBean properties are not emitted
      • setAllowReadOnlyProperties

        public void setAllowReadOnlyProperties​(boolean allowReadOnlyProperties)
        Set to true to include read-only JavaBean properties (the ones without setters) in the YAML document. By default these properties are not included to be able to parse later the same JavaBean.
        Parameters:
        allowReadOnlyProperties - - true to dump read-only JavaBean properties
      • getTimeZone

        public TimeZone getTimeZone()
      • setTimeZone

        public void setTimeZone​(TimeZone timeZone)
        Set the timezone to be used for Date. If set to null UTC is used.
        Parameters:
        timeZone - for created Dates or null to use UTC
      • setAnchorGenerator

        public void setAnchorGenerator​(AnchorGenerator anchorGenerator)