public class InvalidJsonException extends Exception
| Modifier and Type | Method and Description |
|---|---|
static InvalidJsonException |
missingField(String field,
com.eclipsesource.json.JsonValue json)
Creates and returns an exception symbolizing that a required field was missing in some JSON data.
|
static Optional<com.eclipsesource.json.JsonValue> |
optionalField(com.eclipsesource.json.JsonObject json,
String name)
Tries to access a field of a JSON object.
|
static com.eclipsesource.json.JsonValue |
requireField(com.eclipsesource.json.JsonObject json,
String name)
Requires the existence of a field in a JSON object.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static InvalidJsonException missingField(String field, com.eclipsesource.json.JsonValue json)
field - the missing fieldjson - the JSON data that did not contain the fieldpublic static com.eclipsesource.json.JsonValue requireField(com.eclipsesource.json.JsonObject json,
String name)
throws InvalidJsonException
json - the JSON objectname - the name of the fieldJsonObject.get(String)).InvalidJsonException - If the field is not found.public static Optional<com.eclipsesource.json.JsonValue> optionalField(com.eclipsesource.json.JsonObject json, String name)
json - the JSON objectname - the name of the field