You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-5
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
3
3
A JSON5 Library for Java (11+)
4
4
5
-
*This branch contains features of the unreleased [version 1.1.0](https://github.com/json5/json5-spec/milestone/2)*
6
-
7
5
## Overview
8
6
9
7
The [JSON5 Standard](https://json5.org/) tries to make JSON more human-readable
@@ -12,7 +10,7 @@ This is a reference implementation, capable of parsing JSON5 data according to t
12
10
13
11
## Getting started
14
12
15
-
In order to use the code, you can either [download the jar](https://github.com/Synt4xErr0r4/json5/releases/download/1.1.0/json5-1.1.0.jar), or use the Maven dependency:
13
+
In order to use the code, you can either [download the jar](https://github.com/Synt4xErr0r4/json5/releases/download/1.2.0/json5-1.2.0.jar), or use the Maven dependency:
16
14
```xml
17
15
<!-- Repository -->
18
16
@@ -26,7 +24,7 @@ In order to use the code, you can either [download the jar](https://github.com/S
26
24
<dependency>
27
25
<groupId>at.syntaxerror</groupId>
28
26
<artifactId>json5</artifactId>
29
-
<version>1.1.0</version>
27
+
<version>1.2.0</version>
30
28
</dependency>
31
29
```
32
30
@@ -113,6 +111,7 @@ Supported data types are:
113
111
-`int`
114
112
-`float`
115
113
-`double`
114
+
-`Number` (any sub-class)
116
115
-`String`
117
116
-`JSONObject`
118
117
-`JSONArray`
@@ -121,7 +120,7 @@ Supported data types are:
121
120
The normal `getXXX(String key)` and `getXXX(int index)` methods will throw an exception if the specified key or index does not exist, but the
122
121
`getXXX(String key, XXX defaults)` and `getXXX(int index, XXX defaults)` methods will return the default value (parameter `defaults`) instead.
123
122
124
-
The `set(int index, XXX value)` method will also throw an exception if the index does not exist. You can use `add(XXX value)` instead to append a value to the list.
123
+
The `set(int index, Object value)` method will also throw an exception if the index does not exist. You can use `add(Object value)` instead to append a value to the list.
125
124
126
125
The getter-methods for numbers always return a rounded or truncated result.
127
126
If the actual number is too large to fit into the requested type, the upper bits are truncated (e.g. `int` to `byte` truncates the upper 24 bits).
@@ -161,6 +160,14 @@ The following options are currently implemented:
161
160
Whether or not invalid unicode surrogate pairs should be allowed
0 commit comments