001/*
002 * Configurate
003 * Copyright (C) zml and Configurate contributors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *    http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.spongepowered.configurate.yaml;
018
019/**
020 * Representation of blank lines in a YAML document.
021 *
022 * @since 4.3.0
023 */
024public enum BlankLineStyle {
025
026    /**
027     * Don't do any blank line styling.
028     * This includes seeing blank lines during read as formatting, which will be stripped.
029     * To keep those blank lines, use the {@link #KEEP} style.<br>
030     * <br>
031     * This is the default.<br>
032     * <br>
033     * Example: <pre>
034     * {@code
035     *  a: 1
036     *  b:
037     *    c: 1
038     *  e:
039     *    - hello
040     *    - world
041     *  f:
042     *    - name: hello
043     *    - name: world
044     *  g:
045     *    h:
046     *      - name: hello
047     *      - name: world
048     *    i: 1
049     *  j: 1
050     * }</pre>
051     *
052     * @since 4.3.0
053     */
054    NONE,
055    /**
056     * Keep the blank lines just like they were read.<br>
057     * <br>
058     * Note that this option, unlike the others,
059     * will also keep read blank lines (and store it in the comment.)
060     * These blank lines are stored using a special character,
061     * so if you write to a different format you may have to remove them manually.
062     *
063     * @since 4.3.0
064     */
065    KEEP,
066    /**
067     * Add a blank line after a nested node.<br>
068     * <br>
069     * Example: <pre>
070     * {@code
071     *  a: 1
072     *  b:
073     *    c: 1
074     *
075     *  e:
076     *    - hello
077     *    - world
078     *
079     *  f:
080     *    - name: hello
081     *    - name: world
082     *
083     *  g:
084     *    h:
085     *      - name: hello
086     *      - name: world
087     *
088     *    i: 1
089     *
090     *  j: 1
091     * }</pre>
092     *
093     * @since 4.3.0
094     */
095    AFTER_NESTED,
096    /**
097     * Add a blank after every root child, except the last.<br>
098     * <br>
099     * Example: <pre>
100     * {@code
101     *  a: 1
102     *
103     *  b:
104     *    c: 1
105     *
106     *  e:
107     *    - hello
108     *    - world
109     *
110     *  f:
111     *    - name: hello
112     *    - name: world
113     *
114     *  g:
115     *    h:
116     *      - name: hello
117     *      - name: world
118     *    i: 1
119     *
120     *  j: 1
121     * }</pre>
122     *
123     * @since 4.3.0
124     */
125    ROOT_CHILDREN,
126    /**
127     * Prepend a blank line before every node with a comment, except from the first child.<br>
128     * <br>
129     * Example: <pre>
130     * {@code
131     *  # Hello
132     *  a: 1
133     *
134     *  # World
135     *  b:
136     *    # John
137     *    c: 1
138     *
139     *  # Doe
140     *  e:
141     *    - hello
142     *    - world
143     *
144     *  # Jane
145     *  f:
146     *    - name: hello
147     *    - name: world
148     *
149     *  # Doe
150     *  g:
151     *    # Lorum
152     *    h:
153     *      - name: hello
154     *      - name: world
155     *
156     *    # Ipsum
157     *    i: 1
158     *  j: 1
159     * }</pre>
160     *
161     * @since 4.3.0
162     */
163    BEFORE_COMMENT
164
165}