mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-05-28 23:41:30 +00:00
72941c146d
Set the default indentation to 0.
42 lines
1 KiB
Java
42 lines
1 KiB
Java
package com.moandjiezana.toml;
|
|
|
|
/**
|
|
* Controls how a {@link TomlWriter} indents tables and key/value pairs.
|
|
*
|
|
* The default policy is to not indent.
|
|
*/
|
|
public class WriterIndentationPolicy {
|
|
private int tableIndent = 0;
|
|
private int keyValueIndent = 0;
|
|
|
|
public int getTableIndent() {
|
|
return tableIndent;
|
|
}
|
|
|
|
/**
|
|
* Sets the number of spaces a nested table name is indented.
|
|
*
|
|
* @param tableIndent number of spaces to indent
|
|
* @return this WriterIndentationPolicy instance
|
|
*/
|
|
public WriterIndentationPolicy setTableIndent(int tableIndent) {
|
|
this.tableIndent = tableIndent;
|
|
return this;
|
|
}
|
|
|
|
public int getKeyValueIndent() {
|
|
return keyValueIndent;
|
|
}
|
|
|
|
/**
|
|
* Sets the number of spaces key/value pairs within a table are indented.
|
|
*
|
|
* @param keyValueIndent number of spaces to indent
|
|
* @return this WriterIndentationPolicy instance
|
|
*/
|
|
public WriterIndentationPolicy setKeyValueIndent(int keyValueIndent) {
|
|
this.keyValueIndent = keyValueIndent;
|
|
return this;
|
|
}
|
|
}
|