JON (Java Object Notation) is a silly and experimental project that allows Java classes to act as configuration files, automatically serializing static fields into JSON.
  • C 97.4%
  • Batchfile 1.3%
  • Java 1.3%
Find a file
2025-02-20 10:39:17 +03:00
example remove unused deserialization classes and JsonSerializable annotation to clean up codebase 2025-02-19 18:48:03 +03:00
src remove unused deserialization classes and JsonSerializable annotation to clean up codebase 2025-02-19 18:48:03 +03:00
.gitignore init compiler, update .gitignore, add build script, and modify Database class weights 2025-02-13 18:13:41 +03:00
build.bat add JSON serialization support for value types and refactor stack to use value structure 2025-02-17 20:43:35 +03:00
readme.md Update readme.md 2025-02-20 10:39:17 +03:00
run.bat first commit 2025-02-12 19:49:25 +03:00

JON - Java Object Notation

JON (Java Object Notation) is a silly and experimental project that allows Java classes to act as configuration files, automatically serializing static fields into JSON.

Features

  • Uses Java classes as configuration files.
  • Serializes static fields into JSON format.
  • Handles primitive types, arrays, and nested objects.
  • Not production-ready Just for fun and educational purposes!

Example Usage

Define a Java class with static fields:

public class Database {
    public static int port = 65537;
    public static boolean enabled = true;
    public static String name = "example";
    public static String version = "1.0";
    public static float weight = 69.1f;
    public static double[] sizes = { 1.0, 2.0, 3.0 };
    public static String[] hosts = { "localhost", "127.0.0.1" };
    public static Connection connection;
}

Generated JSON output:

{
  "port": 65537,
  "enabled": 1,
  "name": "example",
  "version": "1.0",
  "weight": 69.1,
  "sizes": [1.0, 2.0, 3.0],
  "hosts": ["localhost", "127.0.0.1"],
  "connection": {
    "name": "mysql",
    "address": {
      "host": "localhost",
      "port": 6969
    }
  }
}

Limitations

  • Does not support non-static fields.
  • Does not handle complex object graphs efficiently.
  • No validation or error handling it's just a fun experiment!

License

This project is just for fun and educational purposes. Not suitable for production use!