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
*This branch contains features of the unreleased [version 1.1.0](https://github.com/json5/json5-spec/milestone/2)*
4
6
5
7
## Overview
6
8
@@ -10,7 +12,7 @@ This is a reference implementation, capable of parsing JSON5 data according to t
10
12
11
13
## Getting started
12
14
13
-
In order to use the code, you can either [download the jar](), or use the Maven dependency:
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:
14
16
```xml
15
17
<!-- Repository -->
16
18
@@ -24,7 +26,7 @@ In order to use the code, you can either [download the jar](), or use the Maven
24
26
<dependency>
25
27
<groupId>at.syntaxerror</groupId>
26
28
<artifactId>json5</artifactId>
27
-
<version>1.0.0</version>
29
+
<version>1.1.0</version>
28
30
</dependency>
29
31
```
30
32
@@ -102,7 +104,7 @@ Calling `json.toString(indentFactor)` is the same as `JSONStringify.toString(jso
102
104
103
105
The `getXXX` methods are used to read values from the JSON object/ array.
104
106
The `set` methods are used to override or set values in the JSON object/ array.
105
-
The `add` methods are used to add values to a JSON array.
107
+
The `add`and `insert`methods are used to add values to a JSON array.
106
108
107
109
Supported data types are:
108
110
-`boolean`
@@ -114,6 +116,7 @@ Supported data types are:
114
116
-`String`
115
117
-`JSONObject`
116
118
-`JSONArray`
119
+
-`Instants` (since `1.1.0`, see below)
117
120
118
121
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
119
122
`getXXX(String key, XXX defaults)` and `getXXX(int index, XXX defaults)` methods will return the default value (parameter `defaults`) instead.
@@ -128,6 +131,36 @@ To check if a number can fit into a type, you can use the `getXXXExact` methods,
128
131
Numbers are internally always stored as either a `java.math.BigInteger`, `java.math.BigDecimal`, or `double` (`double` is used for `Infinity` and `NaN` only). Therefore, any method
129
132
returning raw `java.lang.Object`s will return numbers as one of those types. The same behaviour applies to the `getNumber` methods.
130
133
134
+
## Changelog
135
+
### v1.1.0
136
+
137
+
Instants (date and time) are now supported. This option can be toggled via the options listed below.
138
+
139
+
The `JSONOptions` class allows you to customize the behaviour of the parser and stringifyer. It can be created via the builder subclass.
140
+
You can also set the default options used if the supplied options are `null`, by using the method `setDefaultOptions(JSONOptions)`. The default options must not be `null`.
Whether or not string instants (according to [RFC 3339, Section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6)) should be parsed as such.
Whether or not instants should be stringifyed as unix timestamps (integers).
155
+
If this is `false`, instants will be stringifyed as strings (according to [RFC 3339, Section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6))
0 commit comments