Improve wording for array whitespace controls

This commit is contained in:
Jonathan Wood 2015-06-28 13:37:47 -07:00
parent 77f7b922be
commit 1a0d38bc72
2 changed files with 12 additions and 12 deletions

View file

@ -15,7 +15,7 @@ class PrimitiveArrayValueWriter extends ArrayValueWriter {
Collection values = normalize(value);
context.output.append('[');
if (context.getTomlWriter().wantSpaceyArrays()) {
if (!context.getTomlWriter().wantTerseArrays()) {
context.output.append(' ');
}
@ -28,7 +28,7 @@ class PrimitiveArrayValueWriter extends ArrayValueWriter {
first = false;
}
if (context.getTomlWriter().wantSpaceyArrays()) {
if (!context.getTomlWriter().wantTerseArrays()) {
context.output.append(' ');
}
context.output.append(']');

View file

@ -29,7 +29,7 @@ import static com.moandjiezana.toml.ValueWriters.WRITERS;
public class TomlWriter {
private WriterIndentationPolicy indentationPolicy = new WriterIndentationPolicy();
private boolean wantSpaceyArraysValue = true;
private boolean wantTerseArraysValue = true;
private GregorianCalendar calendar = new GregorianCalendar();
private DateFormat customDateFormat = null;
@ -101,25 +101,25 @@ public class TomlWriter {
}
/**
* <p>Control spacing around array brackets in the TOML output.</p>
* <p>Control whitespace in arrays in the TOML output.</p>
*
* <p>Spacey arrays = true (default):</p>
* <p>Terse arrays = false (default):</p>
*
* <pre><code>
* a = [ 1, 2, 3 ]
* </code></pre>
*
* <p>Spacey arrays = false:</p>
* <p>Terse arrays = true:</p>
*
* <pre><code>
* a = [1, 2, 3]
* a = [1,2,3]
* </code></pre>
*
* @param value spacey arrays setting
* @param value terse arrays setting
* @return this TomlWriter instance
*/
public TomlWriter wantSpaceyArrays(boolean value) {
this.wantSpaceyArraysValue = value;
public TomlWriter wantTerseArrays(boolean value) {
this.wantTerseArraysValue = value;
return this;
}
@ -127,8 +127,8 @@ public class TomlWriter {
* Get the current array whitespace policy
* @return the current policy
*/
public boolean wantSpaceyArrays() {
return wantSpaceyArraysValue;
public boolean wantTerseArrays() {
return wantTerseArraysValue;
}
/**