Enum YamlCommentFormat

java.lang.Object
java.lang.Enum<YamlCommentFormat>
org.simpleyaml.configuration.comments.format.YamlCommentFormat
All Implemented Interfaces:
Serializable, Comparable<YamlCommentFormat>, java.lang.constant.Constable

public enum YamlCommentFormat extends Enum<YamlCommentFormat>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    BLANK_LINE comment format gets comments in a readable way stripping the # comment prefix and without indentation, but it keeps trailing spaces and blank lines.
    DEFAULT comment format gets comments in a readable way stripping the # comment prefix, without leading and trailing spaces or blank lines and without indentation.
    PRETTY comment format gets comments in a readable way stripping the # comment prefix, without leading and trailing spaces or blank lines and without indentation.
    RAW comment format gets comments as they are in the file configuration, with blank lines and the comment prefix with # character, but without the indentation prefix.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static void
     
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DEFAULT

      public static final YamlCommentFormat DEFAULT
      DEFAULT comment format gets comments in a readable way stripping the # comment prefix, without leading and trailing spaces or blank lines and without indentation.

      The prefix for setting new comments is:

      - BLOCK comments: "# ", i.e. a # followed by a space.

      - SIDE comments: " # ", i.e. a space followed by # with a space.

      If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.

    • PRETTY

      public static final YamlCommentFormat PRETTY
      PRETTY comment format gets comments in a readable way stripping the # comment prefix, without leading and trailing spaces or blank lines and without indentation.

      The prefix for setting new comments is:

      - BLOCK comments with 0 indentation (root keys) except first key: "\n# ", i.e. a blank line followed by # with a space. Multiline comments do not add additional blank lines.

      - BLOCK comments with some indentation (child keys) or first key: "# ", i.e. a # followed by a space.

      - SIDE comments: " # ", i.e. a space followed by # with a space.

      If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.

    • BLANK_LINE

      public static final YamlCommentFormat BLANK_LINE
      BLANK_LINE comment format gets comments in a readable way stripping the # comment prefix and without indentation, but it keeps trailing spaces and blank lines.

      The prefix for setting new comments is:

      - BLOCK comments: "\n# ", i.e. a blank line followed by # with a space. Multiline comments do not add additional blank lines.

      - SIDE comments: "\n# ", i.e. a new line followed by # with a space. This will add the comment below.

      If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.

    • RAW

      public static final YamlCommentFormat RAW
      RAW comment format gets comments as they are in the file configuration, with blank lines and the comment prefix with # character, but without the indentation prefix.

      The prefix for setting new comments is:

      - BLOCK comments: "# ", i.e. a # followed by a space.

      - SIDE comments: " # ", i.e. a space followed by # with a space.

      If when setting a comment all lines are blank or already prefixed with a comment prefix # then it does not add additional formatting.

  • Method Details

    • values

      public static YamlCommentFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static YamlCommentFormat valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • commentFormatter

      public YamlCommentFormatter commentFormatter()
    • reset

      public static void reset()