Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

NSValidation.ValidationException


Inherits from:
RuntimeException : Exception : Throwable : Object
Package:
com.webobjects.foundation


Class Description


Instances of the NSValidation.ValidationException class are created and thrown when an error condition is encountered during the validation of an object that implements NSValidation. For more information, see the interface specification for NSValidation.




Constants


NSValidation.ValidationException defines the following constants:


Constant Type Description
AdditionalExceptionsKey String The key for an entry in the exception's user info dictionary that contains subexceptions. This constant is deprecated. You should access this user info dictionary entry using the additionalExceptions method.
ValidatedKeyUserInfoKey String The key for an entry in the exception's user info dictionary. The entry contains the key for the property that failed to validate. This constant is deprecated. You should access this user info dictionary entry using the key method.
ValidatedObjectUserInfoKey String A key for an entry in the exception's user info dictionary. The entry contains the object that failed to validate. This constant is deprecated. You should access this user info dictionary entry using the object method.



Constructors



NSValidation.ValidationException

public NSValidation.ValidationException(String message)

Creates and returns a new exception with message as the message.

public NSValidation.ValidationException( String message, NSDictionary userInfo)

Deprecated in the Java Foundation framework. Don't use this method. Use NSValidation.ValidationException(String,Object,String) instead.

public NSValidation.ValidationException( String message, Object anObject, String key)

Creates and returns a new exception with message as the message and a userInfo dictionary specifying anObject for the ValidatedObjectUserInfoKey and key for the ValidatedKeyUserInfoKey.


Static Methods



aggregateExceptionWithExceptions

public static NSValidation.ValidationException aggregateExceptionWithExceptions( NSArray exceptions)

Returns an exception that is the aggregate of the exceptions in the exceptions array. The returned aggregate exception has the message and userInfo dictionary of the first exception in the exceptions array, but the userInfo dictionary is augmented with the list of subexceptions under the key AdditionalExceptionsKey.


Instance Methods



additionalExceptions

public NSArray additionalExceptions()

Returns the array in the receiver's userInfo dictionary for the AdditionalExceptionsKey.

exceptionAddingEntriesToUserInfo

public NSValidation.ValidationException exceptionAddingEntriesToUserInfo( Object anObject, String key)

Deprecated in the Java Foundation framework. Don't use this method. Use exceptionWithObjectAndKey instead. Returns a new exception that is a copy of the receiver message and userInfo, but whose userInfo dictionary has been augmented with anObject and key.

exceptionWithObjectAndKey

public NSValidation.ValidationException exceptionWithObjectAndKey(Object anObject, String key)

Returns a new exception with the same message as the receiver, but whose userInfo dictionary contains contains anObject and key. When validation exceptions are raised by certain validation methods such as validateValueForKey, this method is invoked on the exception to create a duplicate exception with object and property information stored to the new exception's userInfo dictionary. The information is stored under the keys ValidatedObjectUserInfoKey and ValidatedKeyUserInfoKey, respectively. The exception this method returns has the same message as the original, receiving exception; the only difference is the userInfo dictionary.

key

public String key()

Returns the key in the receiver's userInfo dictionary for the ValidatedKeyUserInfoKey.

object

public Object object()

Returns the value in the receiver's userInfo dictionary for the ValidatedObjectUserInfoKey.

userInfo

public NSDictionary userInfo()

Deprecated in the Java Foundation framework. Don't use this method. Access the individual entries using the key and object methods. Returns the receiver's userInfo dictionary.

© 2001 Apple Computer, Inc. (Last Published April 17, 2001)


Table of Contents