diff --git a/hutool-setting/src/main/java/cn/hutool/setting/toml/TomlReader.java b/hutool-setting/src/main/java/cn/hutool/setting/toml/TomlReader.java index 5bf0a00d0..4e3c30330 100644 --- a/hutool-setting/src/main/java/cn/hutool/setting/toml/TomlReader.java +++ b/hutool-setting/src/main/java/cn/hutool/setting/toml/TomlReader.java @@ -20,29 +20,19 @@ import java.time.ZonedDateTime; import java.util.*; /** - * TOML文件读取 - *
- * The datetime support is more extended than in the TOML specification. This reader supports three kind of datetimes: - *
- * This library allows "lenient" bare keys by default, as opposite to the "strict" bare keys required by the TOML - * specification. Strict bare keys may only contain letters, numbers, underscores, and dashes (A-Za-z0-9_-). Lenient - * bare keys may contain any character except those below the space character ' ' in the unicode table, '.', '[', ']' - * and '='. The behaviour of TomlReader regarding bare keys is set in its constructor. - *
+ * 此类支持更加宽松的key,除了{@code A-Za-z0-9_- },还支持' ','.', '[', ']' 和 '=' * * @author TheElectronWill - * */ public class TomlReader { @@ -54,8 +44,8 @@ public class TomlReader { /** * Creates a new TomlReader. * - * @param data the TOML data to read - * @param strictAsciiBareKeystrue to allow only strict bare keys, {@code false} to allow lenient ones.
+ * @param data the TOML data to read
+ * @param strictAsciiBareKeys {@code true} to allow only strict bare keys, {@code false} to allow lenient ones.
*/
public TomlReader(final String data, final boolean strictAsciiBareKeys) {
this.data = data;
@@ -155,6 +145,7 @@ public class TomlReader {
}
}
+ @SuppressWarnings("unchecked")
public Map read() {
final Map map = nextTableContent();
@@ -249,16 +240,16 @@ public class TomlReader {
childMap = new HashMap<>(4);
valueMap.put(part, childMap);
} else if (child instanceof Map) {// table
- childMap = (Map) child;
+ childMap = (Map) child;
} else {// array
- final List