Skip to content

Commit c07c276

Browse files
committed
Add README.md with attribution and build instructions
- Links to original jdk-sandbox repository and specific commit - References the included PDF proposal document - Documents the modifications made for JDK 24 backport - Provides build instructions and API overview
1 parent 10fb210 commit c07c276

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# JSON Experimental - JDK 24 Backport
2+
3+
This repository contains a backport of the experimental JSON API from the [jdk-sandbox project](https://github.com/openjdk/jdk-sandbox) to JDK 24.
4+
5+
## Origin
6+
7+
This code is derived from the official OpenJDK sandbox repository at commit [d22dc2ba89789041c3908cdaafadc1dcf8882ebf](https://github.com/openjdk/jdk-sandbox/commit/d22dc2ba89789041c3908cdaafadc1dcf8882ebf) ("Improve hash code spec wording").
8+
9+
The original proposal and design rationale can be found in the included PDF: [Towards a JSON API for the JDK.pdf](Towards%20a%20JSON%20API%20for%20the%20JDK.pdf)
10+
11+
## Modifications
12+
13+
This is a simplified backport with the following changes from the original:
14+
- Removed StableValue optimizations
15+
- Removed value-based class annotations
16+
- Basic implementation without performance optimizations
17+
- Compatible with JDK 24 instead of future JDK versions
18+
19+
## Building
20+
21+
Requires JDK 24 (Early Access). Build with Maven:
22+
23+
```bash
24+
mvn clean compile
25+
mvn package
26+
```
27+
28+
## License
29+
30+
Licensed under the GNU General Public License version 2 with Classpath exception. See [LICENSE](LICENSE) for details.
31+
32+
## API Overview
33+
34+
The API provides immutable JSON value types:
35+
- `JsonValue` - Base type for all JSON values
36+
- `JsonObject` - JSON objects (key-value pairs)
37+
- `JsonArray` - JSON arrays
38+
- `JsonString` - JSON strings
39+
- `JsonNumber` - JSON numbers
40+
- `JsonBoolean` - JSON booleans (true/false)
41+
- `JsonNull` - JSON null
42+
43+
Parsing is done via the `Json` class:
44+
```java
45+
JsonValue value = Json.parse(jsonString);
46+
```

0 commit comments

Comments
 (0)