# JsonFile Class
1. 性质:实例类
2. 开发目的:Json对象的读写
## 方法 Method
### _New(path)
- path - JsonFile文件的路径
会先检查路径是否合法:如果路径不合法,会抛出异常。
### load()
从JsonFile文件中加载JsonObject,文件不存在,会加载空`json`。
### init(aDefaultObject)
使用默认Object,对JSON进行初始化。
也就是检查出JSON中所有的缺失项,并填入默认值。
### store(jsonObj)
向JsonFile文件中存储JsonObject
```Java
path := "D:\AHKs\Dev\APPBookMarkGroup\MyTomato.json"
jf := new JsonFile(path)
array := jf.load()
LogPrintln(array,A_LineFile "(" A_LineNumber ")" " : " "array >>> `r`n")
array[3] := "New"
content := jf.store(array)
LogPrintln(content,A_LineFile "(" A_LineNumber ")" " : " "content >>> `r`n")
```
```AutoHotKey
>"F:\gUAPP\AutoHotkey32Bit\SciTE\..\AutoHotkey.exe" /ErrorStdOut "D:\AHKs\ahk_lib\IO\Example_JsonFile.ahk"
A_ScriptName >>> Example_JsonFile.ahk
D:\AHKs\ahk_lib\IO\Example_JsonFile.ahk(38) : array >>>
[{title:MyGridPane [D:\JavaProject\MyGridPane]},{title:MyTomato [D:\JavaProject\MyTomato]},New]
D:\AHKs\ahk_lib\IO\Example_JsonFile.ahk(44) : content >>>
[{"title":"MyGridPane [D:\\JavaProject\\MyGridPane]"},{"title":"MyTomato [D:\\JavaProject\\MyTomato]"},"New"]
```
- 指南 (README)
- 常见问题 (FAQ)
- 更新历史(CHANGELOG)
- 贡献指南 (CONTRIBUTING)
- 开源协议 (LICENCE)
- 鸣谢 (ACKNOWLEDGEMENT)
- 文档模板 (TEMPLATE)
- 新手指南(BEGINNER_GUIDE)
- 语法高亮(HIGHLIGHTING)
- Class
- _Container
- _EX
- _List
- _Map
- _Win
- _Wins
- BeanEnum
- HotString
- HotStringMaps
- InvisibleCharacter
- JSON
- JsonFile
- Method
- ObservableMap
- ObservableObj
- WinEvent
- Timer
- MesToast
- APPLocker
- AutoClassify
- Everything
- Function
- Ini
- AutoInputBox
- ParaChecker
- PathObj
- RunningSpeedTest
- Script
- Switcher
- Stack
- TimeChecker
- Type
- UMSS
- Function
- assert()
- Analyze()
- AnalyzeClassName()
- AutoBind()
- bulkMoveFile()
- ExcelToList()
- getClass()
- getCurrentTime()
- getFunc()
- Instanof()
- InstanceCheck()
- loadMethod()
- LogPrintln()
- rawCall()
- RandomStr()
- showObj()
- Type()
- throwWithSt()
- UseCMD()
- ObjDump()
- Test
- ObjLoad()
- StringMethod
- TypeClass
- MapFactory()