diff --git a/src/configuration/JsonToJava.java b/src/configuration/JsonToJava.java new file mode 100644 index 0000000..5f2961b --- /dev/null +++ b/src/configuration/JsonToJava.java @@ -0,0 +1,23 @@ +package configuration; + +import java.io.*; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +public class JsonToJava { + public static void main(String args[]) { + JSONParser jsonP = new JSONParser(); + try { + JSONObject jsonO = (JSONObject)jsonP.parse(new FileReader("src/configuration/config.json")); + + String test = (String) jsonO.get("test"); + System.out.println("Name :"+ test); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (ParseException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file