A Java program taking JSON input and outputting a flattened JSON object.
- Install Java Development Kit (JDK)
- Includes:
- Java Compiler - For compiling Java source code
- Java Runtime Environment (JRE) & Java Virtual Machine (JVM) - For running Java byte code
- Downloads & Platform Specific Instructions:
- Includes:
- Open a terminal window (e.g. GitBash) and change the directory to where you want to place the cloned repo.
- Clone the repo
# using ssh
git clone git@github.com:elle-j/JSON-Flattener.git
# using https
git clone https://github.com/elle-j/JSON-Flattener.git
- Change directory to the source code directory
cd ./JSON-Flattener/java-program/src/
- Compile the source code
javac -cp . ./dev/ellej/*.java
- Run the program
# replace <json_object> with a valid JSON object
java dev.ellej.Main <json_object>
# example 1:
java dev.ellej.Main '{ "a": 1, "b": true, "c": { "d": 3, "e": "test" } }'
# example 2:
cat /path/to/file.json | java dev.ellej.Main
- The program will always receive an input when run
- The input will always be a valid JSON object
- The JSON object will not contain arrays