Class SchemaException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.forgerock.json.JsonException
-
- org.forgerock.json.JsonValueException
-
- org.forgerock.json.schema.validator.exceptions.SchemaException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ValidationException
public class SchemaException extends JsonValueException
Encapsulate a general JSON validator error.If the validator needs to include information about a specific location in an JSON document, it should use the
ValidationException
subclass.- See Also:
ValidationException
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SchemaException(JsonValue value, Exception e)
Create a new SchemaException wrapping an existing exception.SchemaException(JsonValue value, String message)
Create the exception with the given value and message.SchemaException(JsonValue value, String message, Exception e)
Create a new SchemaException from an existing exception.SchemaException(JsonValue value, String message, Throwable throwable)
Create the exception with the given value, message and cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Exception
getException()
Return the embedded exception, if any.String
getMessage()
Return a detail message for this exception.String
toString()
Override toString to pick up any embedded exception.-
Methods inherited from class org.forgerock.json.JsonValueException
getJsonValue
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
SchemaException
public SchemaException(JsonValue value, String message)
Create the exception with the given value and message.- Parameters:
value
- The value.message
- The message.
-
SchemaException
public SchemaException(JsonValue value, String message, Throwable throwable)
Create the exception with the given value, message and cause.- Parameters:
value
- The value.message
- The message.throwable
- The cause.
-
SchemaException
public SchemaException(JsonValue value, Exception e)
Create a new SchemaException wrapping an existing exception.The existing exception will be embedded in the new one, and its message will become the default message for the SchemaException.
- Parameters:
value
- The value.e
- The exception to be wrapped in a SchemaException.
-
SchemaException
public SchemaException(JsonValue value, String message, Exception e)
Create a new SchemaException from an existing exception.The existing exception will be embedded in the new one, but the new exception will have its own message.
- Parameters:
value
- The value.message
- The detail message.e
- The exception to be wrapped in a SchemaException.
-
-
Method Detail
-
getMessage
public String getMessage()
Return a detail message for this exception.If there is an embedded exception, and if the SchemaException has no detail message of its own, this method will return the detail message from the embedded exception.
- Overrides:
getMessage
in classJsonValueException
- Returns:
- The error or warning message.
-
getException
public Exception getException()
Return the embedded exception, if any.- Returns:
- The embedded exception, or null if there is none.
-
-