org.exolab.castor.xml

Class ValidationException


public class ValidationException
extends XMLException

An exception that can be used to signal XML validation errors
Version:
$Revision: 6216 $ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
Author:
Keith Visco

Constructor Summary

ValidationException()
Creates a new ValidationException with no message, or nested Exception
ValidationException(String message)
Creates a new ValidationException with the given message.
ValidationException(String message, Exception exception, int errorCode)
Creates a new ValidationException with the given message, nested exception, and errorCode.
ValidationException(String message, Throwable exception)
Creates a new ValidationException with the given message and nested exception.
ValidationException(String message, int errorCode)
Creates a new ValidationException with the given message.
ValidationException(Throwable exception)
Creates a new ValidationException with the given nested exception.

Method Summary

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.
protected void
setNext(ValidationException exception)
Sets the given ValidationException as the next exception in the list.
String
toString()
Returns the String representation of this Exception

Methods inherited from class org.exolab.castor.xml.XMLException

getErrorCode, setErrorCode, setLocation, toString

Methods inherited from class org.exolab.castor.core.exceptions.CastorException

getCause, getMessage, initCause, printStackTrace, printStackTrace, printStackTrace

Constructor Details

ValidationException

public ValidationException()
Creates a new ValidationException with no message, or nested Exception

ValidationException

public ValidationException(String message)
Creates a new ValidationException with the given message.
Parameters:
message - the message for this Exception

ValidationException

public ValidationException(String message,
                           Exception exception,
                           int errorCode)
Creates a new ValidationException with the given message, nested exception, and errorCode.
Parameters:
message - the detail message for this exception
exception - the nested exception
errorCode - the errorCode for this Exception

ValidationException

public ValidationException(String message,
                           Throwable exception)
Creates a new ValidationException with the given message and nested exception.
Parameters:
message - the detail message for this exception
exception - the nested exception

ValidationException

public ValidationException(String message,
                           int errorCode)
Creates a new ValidationException with the given message.
Parameters:
message - the message for this Exception
errorCode - the errorCode for this Exception

ValidationException

public ValidationException(Throwable exception)
Creates a new ValidationException with the given nested exception.
Parameters:
exception - the nested exception

Method Details

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.

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 calling #setNext if no additional ValidationException(s) exist.
Parameters:
exception - the ValidationException to set as the last exception in the list.

setLocation

public void setLocation(Location location)
Sets the location information for this ValidationException.
Overrides:
setLocation in interface XMLException
Parameters:
location - The location information for this validation exception.

setNext

protected 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 String toString()
Returns the String representation of this Exception
Overrides:
toString in interface XMLException
Returns:
the String representation of this Exception

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com