cleaning up comments

This commit is contained in:
iadgovuser58 2024-06-03 18:07:04 -04:00 committed by chubtub
parent 1c5bf6a48c
commit d43db09c44
2 changed files with 35 additions and 6 deletions

View File

@ -101,15 +101,31 @@ public final class JsonUtils {
return jsonObject; return jsonObject;
} }
/**
* Getter for the JSON Object that is associated with the elementName value
* mapped in the associated JSON file.
* Default {@link java.nio.charset.Charset} is UTF 8
*
* @param jsonFilename the object holding the name of the file in classpath to parse.
* @param elementName the specific object to pull from the file
* @return a JSON object
*/
public static JsonObject getSpecificJsonObject(final String jsonFilename, final String elementName) { public static JsonObject getSpecificJsonObject(final String jsonFilename, final String elementName) {
// find the file and load it // find the file and load it
return getSpecificJsonObject(jsonFilename, elementName, StandardCharsets.UTF_8); return getSpecificJsonObject(jsonFilename, elementName, StandardCharsets.UTF_8);
} }
/**
* Getter for the JSON Object that is associated with the elementName value
* mapped in the associated JSON file.
* Default {@link java.nio.charset.Charset} is UTF 8
*
* @param jsonFilename the object holding the name of the file in classpath to parse.
* @param elementName the specific object to pull from the file
* @param charset the character set to use
* @return a JSON object
*/
public static JsonObject getSpecificJsonObject(final String jsonFilename, public static JsonObject getSpecificJsonObject(final String jsonFilename,
final String elementName, final String elementName,
final Charset charset) { final Charset charset) {
@ -123,10 +139,24 @@ public final class JsonUtils {
return new JsonObject(); return new JsonObject();
} }
/**
* Getter for the JSON Object that is mapped in the associated JSON file.
* Default {@link java.nio.charset.Charset} is UTF 8
*
* @param jsonFilename the object holding the name of the file in classpath to parse.
* @return a JSON object
*/
public static JsonObject getJsonObject(final String jsonFilename) { public static JsonObject getJsonObject(final String jsonFilename) {
return getJsonObject(jsonFilename, StandardCharsets.UTF_8); return getJsonObject(jsonFilename, StandardCharsets.UTF_8);
} }
/**
* Getter for the JSON Object that is mapped in the associated JSON file.
*
* @param jsonFilename the object holding the name of the file in classpath to parse.
* @param charset the character set to use
* @return a JSON object
*/
public static JsonObject getJsonObject(final String jsonFilename, final Charset charset) { public static JsonObject getJsonObject(final String jsonFilename, final Charset charset) {
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();

View File

@ -88,8 +88,7 @@ public class UefiGuid {
} }
else { else {
// could not access vendor-table.json from filesystem, so attempt to access from code // could not access vendor-table.json from filesystem, so attempt to access from code
uefiVendorRef = JsonUtils.getSpecificJsonObject(JSON_FILENAME, "VendorTable", uefiVendorRef = JsonUtils.getSpecificJsonObject(JSON_FILENAME, "VendorTable");
StandardCharsets.UTF_8);
if(!isVendorTableReferenceHandleEmpty()) { if(!isVendorTableReferenceHandleEmpty()) {
vendorTableFileStatus = FILESTATUS_FROM_CODE; vendorTableFileStatus = FILESTATUS_FROM_CODE;
} }