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:
java.io.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(java.lang.String msg)
Constructor from message.ValidationException(java.lang.String msg, java.lang.Object obj)
Constructor from message and validation object.ValidationException(java.lang.String msg, java.lang.Object obj, IUnmarshallingContext ctx)
Constructor from message, validation object, and unmarshalling context.ValidationException(java.lang.String msg, java.lang.Throwable root)
Constructor from message and wrapped exception.ValidationException(java.lang.String msg, java.lang.Throwable root, java.lang.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 java.lang.String
addDescription(java.lang.String msg, java.lang.Object obj)
Add description information for a validation object to message.static java.lang.String
describe(java.lang.Object obj)
Get description information for a validation object.java.lang.String
getMessage()
Get exception description.-
Methods inherited from class org.jibx.runtime.JiBXException
getCause, getRootCause, printStackTrace, printStackTrace, printStackTrace
-
-
-
-
Constructor Detail
-
ValidationException
public ValidationException(java.lang.String msg)
Constructor from message.- Parameters:
msg
- message describing the exception condition
-
ValidationException
public ValidationException(java.lang.String msg, java.lang.Throwable root)
Constructor from message and wrapped exception.- Parameters:
msg
- message describing the exception conditionroot
- exception which caused this exception
-
ValidationException
public ValidationException(java.lang.String msg, java.lang.Object obj)
Constructor from message and validation object.- Parameters:
msg
- message describing the exception conditionobj
- source object for validation error
-
ValidationException
public ValidationException(java.lang.String msg, java.lang.Throwable root, java.lang.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(java.lang.String msg, java.lang.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 java.lang.String describe(java.lang.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 java.lang.String addDescription(java.lang.String msg, java.lang.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 java.lang.String getMessage()
Get exception description.- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- message describing the exception condition
-
-