Class JsonValidator
java.lang.Object
com.developer.nefarious.zjoule.plugin.login.utils.JsonValidator
Utility class for validating JSON strings.
This class provides a static method to check whether a given string is valid JSON. It uses the Google Gson library to attempt parsing the string and determine its validity.
This class is abstract to prevent instantiation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isValidJson
(String json) Validates whether a given string is a well-formed JSON.
-
Method Details
-
isValidJson
Validates whether a given string is a well-formed JSON.- Parameters:
json
- the string to validate.- Returns:
true
if the string is valid JSON,false
otherwise.
-