Package org.exolab.castor.xml
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.exolab.castor.core.exceptions.CastorException
-
- org.exolab.castor.xml.XMLException
-
- org.exolab.castor.xml.ValidationException
-
- All Implemented Interfaces:
java.io.Serializable
public class ValidationException extends XMLException
An Exception that can be used to signal XML validation errors.- Version:
- $Revision$ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
- Author:
- Keith Visco
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationException()
Creates a new ValidationException with no message or nested Exception.ValidationException(java.lang.String message)
Creates a new ValidationException with the given message.ValidationException(java.lang.String message, int errorCode)
Creates a new ValidationException with the given message.ValidationException(java.lang.String message, java.lang.Exception exception, int errorCode)
Creates a new ValidationException with the given message, nested Exception, and errorCode.ValidationException(java.lang.String message, java.lang.Throwable exception)
Creates a new ValidationException with the given message and nested Exception.ValidationException(java.lang.Throwable exception)
Creates a new ValidationException with the given nested Exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Location
getLocation()
Returns the location of the Exception.ValidationException
getNext()
Returns the next ValidationException in the list, or null if no additional validation exceptions exist.protected boolean
remove(ValidationException exception)
Removes the given ValidationException from the current list of ValidationException.protected void
setLast(ValidationException exception)
Adds the given ValidationException as the last exception in the list.void
setLocation(Location location)
Sets the location information for this ValidationException.void
setNext(ValidationException exception)
Sets the given ValidationException as the next Exception in the list.java.lang.String
toString()
Returns the String representation of this ValidationException.-
Methods inherited from class org.exolab.castor.xml.XMLException
getErrorCode, setErrorCode
-
Methods inherited from class org.exolab.castor.core.exceptions.CastorException
getCause, getMessage, initCause, printStackTrace, printStackTrace, printStackTrace
-
-
-
-
Constructor Detail
-
ValidationException
public ValidationException()
Creates a new ValidationException with no message or nested Exception.
-
ValidationException
public ValidationException(java.lang.String message)
Creates a new ValidationException with the given message.- Parameters:
message
- the message for this Exception
-
ValidationException
public ValidationException(java.lang.String message, int errorCode)
Creates a new ValidationException with the given message.- Parameters:
message
- the message for this ExceptionerrorCode
- the errorCode for this Exception
-
ValidationException
public ValidationException(java.lang.Throwable exception)
Creates a new ValidationException with the given nested Exception.- Parameters:
exception
- the nested Exception
-
ValidationException
public ValidationException(java.lang.String message, java.lang.Throwable exception)
Creates a new ValidationException with the given message and nested Exception.- Parameters:
message
- the detail message for this Exceptionexception
- the nested Exception
-
ValidationException
public ValidationException(java.lang.String message, java.lang.Exception exception, int errorCode)
Creates a new ValidationException with the given message, nested Exception, and errorCode.- Parameters:
message
- the detail message for this Exceptionexception
- the nested ExceptionerrorCode
- the errorCode for this Exception
-
-
Method Detail
-
getLocation
public Location getLocation()
Returns the location of the Exception.- Returns:
- the location of the Exception.
-
getNext
public ValidationException getNext()
Returns the next ValidationException in the list, or null if no additional validation exceptions exist.- Returns:
- the next ValidationException in the list, or null if there are no additional Exceptions.
-
setLocation
public void setLocation(Location location)
Sets the location information for this ValidationException.- Overrides:
setLocation
in classXMLException
- Parameters:
location
- The location information for this validation Exception.
-
remove
protected boolean remove(ValidationException exception)
Removes the given ValidationException from the current list of ValidationException.- Parameters:
exception
- the ValidationException to remove- Returns:
- true if the given ValidationException was successfully removed.
-
setLast
protected void setLast(ValidationException exception)
Adds the given ValidationException as the last exception in the list. This is equivalent to callingsetNext(org.exolab.castor.xml.ValidationException)
if no additional ValidationException(s) exist.- Parameters:
exception
- the ValidationException to set as the last exception in the list.
-
setNext
public void setNext(ValidationException exception)
Sets the given ValidationException as the next Exception in the list. This method will overwrite any existing ValidationException that may already exist as the next Exception.- Parameters:
exception
- the ValidationException to set as the next Exception in the list.
-
toString
public java.lang.String toString()
Returns the String representation of this ValidationException.- Overrides:
toString
in classXMLException
- Returns:
- the String representation of this ValidationException.
-
-