-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added org.json and toml4j - Fixed bugs with UI updating during extraction - realised init is kinda pointless tbh - cleaned up the code a little, removed useless imports - added TOML and JSON storage in DataManager - fixed bugs / missing code in extraction - grammar correction - Added JSON Parsing - Added TOML Parsing - Added YAML Parsing - created overview FXML but not started
- Loading branch information
Showing
11 changed files
with
369 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/skullian/binarysearchinator/util/jar/parsing/ParseJSON.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,33 @@ | ||
package skullian.binarysearchinator.util.jar.parsing; | ||
|
||
import org.json.JSONObject; | ||
import skullian.binarysearchinator.MainApp; | ||
import skullian.binarysearchinator.control.ErrorHandler; | ||
import skullian.binarysearchinator.util.jar.Extractor; | ||
import skullian.binarysearchinator.util.jar.data.DataManager; | ||
|
||
import java.io.FileReader; | ||
import java.io.IOException; | ||
import java.util.Arrays; | ||
import java.util.logging.Logger; | ||
|
||
public class ParseJSON { | ||
private static Logger LOGGER = MainApp.LOGGER; | ||
|
||
public static void parseJSON(String output, String processed, String filename) { | ||
try { | ||
FileReader reader = new FileReader(output + "\\" + filename); | ||
JSONObject jsonObject = new JSONObject(reader); | ||
|
||
String fullName = jsonObject.getString("name"); | ||
|
||
DataManager.addFileStorage(processed, fullName); | ||
DataManager.addJSONStorage(fullName, jsonObject); | ||
} catch (IOException error) { | ||
ErrorHandler.error = "An unexpected error occured when parsing JSON files: \n" + error; | ||
ErrorHandler.setErrorMessage(Extractor.pane); | ||
LOGGER.severe("An unexpected error occured when parsing JSON files."); | ||
LOGGER.severe(Arrays.toString(error.getStackTrace())); | ||
} | ||
} | ||
} |
Oops, something went wrong.