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
public class ValidationException extends RecoverableException
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationException(String msg)Constructor 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringaddDescription(String msg, Object obj)Add description information for a validation object to message.static Stringdescribe(Object obj)Get description information for a validation object.StringgetMessage()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 Detail
-
ValidationException
public ValidationException(String msg)
Constructor from message.- Parameters:
msg- message describing the exception condition
-
ValidationException
public ValidationException(String msg, Throwable root)
Constructor from message and wrapped exception.- Parameters:
msg- message describing the exception conditionroot- exception which caused this exception
-
ValidationException
public ValidationException(String msg, Object obj)
Constructor from message and validation object.- Parameters:
msg- message describing the exception conditionobj- source object for validation error
-
ValidationException
public ValidationException(String msg, Throwable root, Object obj)
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
public ValidationException(String msg, Object obj, IUnmarshallingContext ctx)
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 Detail
-
describe
public static String describe(Object obj)
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
public static String addDescription(String msg, Object obj)
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
public String getMessage()
Get exception description.- Overrides:
getMessagein classThrowable- Returns:
- message describing the exception condition
-
-