Package org.jibx.runtime
Class ValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jibx.runtime.JiBXException
org.jibx.runtime.RecoverableException
org.jibx.runtime.ValidationException
- All Implemented Interfaces:
Serializable
Validation exception class. This is used for marshalling and unmarshalling
errors that relate to data content.
- Version:
- 1.0
- Author:
- Dennis M. Sosnoski
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor from message.ValidationException
(String msg, Object obj) Constructor from message and validation object.ValidationException
(String msg, Object obj, IUnmarshallingContext ctx) Constructor from message, validation object, and unmarshalling context.ValidationException
(String msg, Throwable root) Constructor from message and wrapped exception.ValidationException
(String msg, Throwable root, Object obj) Constructor from message, wrapped exception, and validation object. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
addDescription
(String msg, Object obj) Add description information for a validation object to message.static String
Get description information for a validation object.Get exception description.Methods inherited from class org.jibx.runtime.JiBXException
getCause, getRootCause, printStackTrace, printStackTrace, printStackTrace
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Constructor Details
-
ValidationException
Constructor from message.- Parameters:
msg
- message describing the exception condition
-
ValidationException
Constructor from message and wrapped exception.- Parameters:
msg
- message describing the exception conditionroot
- exception which caused this exception
-
ValidationException
Constructor from message and validation object.- Parameters:
msg
- message describing the exception conditionobj
- source object for validation error
-
ValidationException
Constructor from message, wrapped exception, and validation object.- Parameters:
msg
- message describing the exception conditionroot
- exception which caused this exceptionobj
- source object for validation error
-
ValidationException
Constructor from message, validation object, and unmarshalling context.- Parameters:
msg
- message describing the exception conditionobj
- source object for validation errorctx
- context used for unmarshalling
-
-
Method Details
-
describe
Get description information for a validation object. For an unmarshalled object with source references available this returns the source position description. Otherwise, it returns the result of aObject.toString()
method call.- Parameters:
obj
- source object for validation error- Returns:
- object description text
-
addDescription
Add description information for a validation object to message. This just appends the result of adescribe(java.lang.Object)
call to the supplied message, with some appropriate formatting.- Parameters:
msg
- base message textobj
- source object for validation error- Returns:
- message with object description appended
-
getMessage
Get exception description.- Overrides:
getMessage
in classThrowable
- Returns:
- message describing the exception condition
-