⚙ Java Properties 转 JSONConvert Properties to JSON
把 Java .properties 文本解析成嵌套 JSON 对象(按点号拆键)。本地处理。可设置「压缩输出」。Parse Java .properties text into a nested JSON object (keys split on dots). Processed locally. Settings: Minify.
使用说明与常见问题How-to & FAQ
「Java Properties 转 JSON」是什么?What is the Convert Properties to JSON tool?
把 Java .properties 文本解析成嵌套 JSON 对象(按点号拆键)。本地处理。可设置「压缩输出」。Parse Java .properties text into a nested JSON object (keys split on dots). Processed locally. Settings: Minify.
如何使用「Java Properties 转 JSON」?How do I use the Convert Properties to JSON tool?
在「Java Properties 转 JSON」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。In the Convert Properties to JSON: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it.
值总是字符串吗?Are values always strings?
是的,.properties 没有类型;1、true 都会成为字符串 "1"、"true",需要数字请自行转换。Yes — .properties has no types, so 1 and true become the strings "1" and "true"; convert numbers yourself if needed.
支持哪些 .properties 写法?Which .properties syntax is supported?
按 Java 规则:# 或 ! 开头是注释;键和值之间可以用 =、: 或空白分隔(a b=1 的键是 a,值是 b=1);只有键没有值时值为空;行尾奇数个反斜杠表示续行,下一行开头的空白会被去掉;支持 \uXXXX、\t、\n、\r、\\ 等转义。键按未转义的点号拆成嵌套对象,写成 a\.b 的点号保留在键名里。Java rules: lines starting with # or ! are comments; key and value can be separated by =, : or whitespace (in a b=1 the key is a and the value b=1); a key with no value gets an empty value; an odd number of backslashes at the end of a line continues it, and leading whitespace on the next line is dropped; escapes such as \uXXXX, \t, \n, \r and \\ are decoded. Keys are split into nested objects on unescaped dots; a dot written as a\.b stays inside the key.
键冲突会怎样?What happens with conflicting keys?
重复的键保留后面的值;a=1 和 a.b=2 这类一个是值、一个是子对象的冲突,以后出现的为准。两种情况都会在结果下方提示行号,不会悄悄丢掉。A repeated key keeps the later value; for conflicts such as a=1 and a.b=2 (a value versus child keys) the later line wins. Both cases are reported below the result with line numbers instead of being dropped silently.
输入和输出是什么样的?What does the input and output look like?
例如在「Java Properties 转 JSON」中输入 a=1 ⏎ b.c=hi,输出为:{ ⏎ "a": "1", ⏎ "b": { ⏎ "c": "hi" ⏎ } ⏎ }(⏎ 表示换行)。For example, the Convert Properties to JSON turns the input a=1 ⏎ b.c=hi into: { ⏎ "a": "1", ⏎ "b": { ⏎ "c": "hi" ⏎ } ⏎ } (⏎ marks a line break).
有哪些选项可以调整?What options can I adjust?
「Java Properties 转 JSON」的设置:可勾选:「压缩输出」。每次生成结果都按当前设置处理。Settings in the Convert Properties to JSON — tick boxes: "Minify". The result always uses the current settings.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「Java Properties 转 JSON」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Convert Properties to JSON runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「Java Properties 转 JSON」免费吗?需要注册吗?Is the Convert Properties to JSON free? Do I need an account?
「Java Properties 转 JSON」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Convert Properties to JSON is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.