mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-12-28 19:24:15 +00:00
Clarified Usage and added TODO
This commit is contained in:
parent
58224344f0
commit
3dda0b7701
1 changed files with 11 additions and 3 deletions
14
README.md
14
README.md
|
@ -30,11 +30,15 @@ Add the following dependency:
|
|||
|
||||
## Usage
|
||||
|
||||
1. Create a com.moandjiezana.toml.Toml4J instance
|
||||
1. Call the `parse` method of your choice
|
||||
1. Use the getters to retrieve the data
|
||||
|
||||
````java
|
||||
Toml toml = new Toml().parse(getTomlFile()); // throws an Exception if the TOML is incorrect
|
||||
|
||||
String title = toml.getString("title"); // if a key doesn't exist, returns null
|
||||
Boolean enabled = toml.getBoolean("database.enabled"); // gets the key enabled from the key group database
|
||||
Boolean enabled = toml.getBoolean("database.enabled"); // gets the value of enabled from the database key group
|
||||
Toml servers = toml.getKeyGroup("servers"); // returns a new Toml instance containing only the key group's values
|
||||
````
|
||||
|
||||
|
@ -51,8 +55,12 @@ Long b = toml.getLong("b"); // returns 3
|
|||
Long c = toml.getLong("c"); // returns null
|
||||
````
|
||||
|
||||
## TODO
|
||||
|
||||
* Support all special characters
|
||||
* Convert Toml to custom class
|
||||
|
||||
## License
|
||||
|
||||
toml4j is copyright of Moandji Ezana
|
||||
toml4j is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php)
|
||||
toml4j is copyright of Moandji Ezana and is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php)
|
||||
|
||||
|
|
Loading…
Reference in a new issue