public class TomlWriter extends Object
日期格式支持:
LocalDateLocalDateTimeZonedDateTime
此类支持更加宽松的key,除了A-Za-z0-9_- ,其他key使用"包装。
| 构造器和说明 |
|---|
TomlWriter(Writer writer)
Creates a new TomlWriter with the defaults parameters.
|
TomlWriter(Writer writer,
int indentSize,
boolean indentWithSpaces)
Creates a new TomlWriter with the specified parameters.
|
TomlWriter(Writer writer,
int indentSize,
boolean indentWithSpaces,
String lineSeparator)
Creates a new TomlWriter with the specified parameters.
|
public TomlWriter(Writer writer)
TomlWriter(writer, 1, false, System.lineSeparator().writer - where to write the datapublic TomlWriter(Writer writer, int indentSize, boolean indentWithSpaces)
TomlWriter(writer, indentSize, indentWithSpaces, System.lineSeparator()).writer - where to write the dataindentSize - the size of each indentindentWithSpaces - true to indent with spaces, false to indent with tabspublic TomlWriter(Writer writer, int indentSize, boolean indentWithSpaces, String lineSeparator)
writer - where to write the dataindentSize - the size of each indentindentWithSpaces - true to indent with spaces, false to indent with tabslineSeparator - the String to write to break linespublic void close()
throws IOException
IOException - if an error occurspublic void flush()
throws IOException
IOException - if an error occurspublic void write(Map<String,Object> data) throws IORuntimeException
data - the data to writeIORuntimeException - if an error occursCopyright © 2023. All rights reserved.