WebObjects 5.2

com.webobjects.foundation
Class NSValidation.ValidationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.webobjects.foundation.NSValidation.ValidationException
All Implemented Interfaces:
Serializable
Enclosing class:
NSValidation

public static class NSValidation.ValidationException
extends RuntimeException

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.

See Also:
Serialized Form

Field Summary
static String AdditionalExceptionsKey
          Deprecated. Use additionalExceptions()
static String ValidatedKeyUserInfoKey
          Deprecated. Use key()
static String ValidatedObjectUserInfoKey
          Deprecated. User object()
 
Constructor Summary
NSValidation.ValidationException(String message)
          Creates and returns a new exception with message as the message.
NSValidation.ValidationException(String message, NSDictionary userInfo)
          Deprecated. Use NSValidation.ValidationException(String, Object, String)
NSValidation.ValidationException(String message, Object object, String key)
          Creates and returns a new exception with message as the message and a userInfo dictionary specifying object for the ValidatedObjectUserInfoKey and key for the ValidatedKeyUserInfoKey.
 
Method Summary
 NSArray additionalExceptions()
          Returns the array in this NSValidation's userInfo dictionary for the AdditionalExceptionsKey.
static NSValidation.ValidationException aggregateExceptionWithExceptions(NSArray aggregateExceptions)
          Returns an exception that is the aggregate of the exceptions in the aggregateExceptions array.
 NSValidation.ValidationException exceptionAddingEntriesToUserInfo(Object object, String key)
          Deprecated. Use exceptionWithObjectAndKey(java.lang.Object, java.lang.String)
 NSValidation.ValidationException exceptionWithObjectAndKey(Object object, String key)
          Returns a new exception with the same message as this ValidationException, but whose userInfo dictionary contains object and key.
 String key()
           
 Object object()
           
 NSDictionary userInfo()
          Deprecated. Access the individual entries using the key() and object() methods.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AdditionalExceptionsKey

public static final String AdditionalExceptionsKey
Deprecated. Use additionalExceptions()

The key for an entry in the exception's user info dictionary that contains subexceptions.

ValidatedKeyUserInfoKey

public static final String ValidatedKeyUserInfoKey
Deprecated. Use key()

The key for an entry in the exception's user info dictionary. The entry contains the key for the property that failed to validate.

ValidatedObjectUserInfoKey

public static final String ValidatedObjectUserInfoKey
Deprecated. User object()

A key for an entry in the exception's user info dictionary. The entry contains the object that failed to validate.
Constructor Detail

NSValidation.ValidationException

public NSValidation.ValidationException(String message)
Creates and returns a new exception with message as the message.
Parameters:
message - message giving the datails of the exception

NSValidation.ValidationException

public NSValidation.ValidationException(String message,
                                        Object object,
                                        String key)
Creates and returns a new exception with message as the message and a userInfo dictionary specifying object for the ValidatedObjectUserInfoKey and key for the ValidatedKeyUserInfoKey.
Parameters:
message - exception message
object - object on the destination showed by the keypath
key - property of the NSValidation implementor
See Also:
object(), key()

NSValidation.ValidationException

public NSValidation.ValidationException(String message,
                                        NSDictionary userInfo)
Deprecated. Use NSValidation.ValidationException(String, Object, String)

Parameters:
message - exception message
userInfo - information array giving the related object and the key
See Also:
NSValidation.ValidationException(String, Object, String)
Method Detail

additionalExceptions

public NSArray additionalExceptions()
Returns the array in this NSValidation's userInfo dictionary for the AdditionalExceptionsKey.
Returns:
corresponding array in the userinfo dictionary.

aggregateExceptionWithExceptions

public static NSValidation.ValidationException aggregateExceptionWithExceptions(NSArray aggregateExceptions)
Returns an exception that is the aggregate of the exceptions in the aggregateExceptions array. The returned aggregate exception has the message and userInfo dictionary of the first exception in the aggregateExceptions array, but the userInfo dictionary is augmented with the list of subexceptions under the key AdditionalExceptionsKey.
Parameters:
aggregateExceptions - array of the exceptions
Returns:
exception giving the related object and the key
See Also:
AdditionalExceptionsKey

exceptionAddingEntriesToUserInfo

public NSValidation.ValidationException exceptionAddingEntriesToUserInfo(Object object,
                                                                         String key)
Deprecated. Use exceptionWithObjectAndKey(java.lang.Object, java.lang.String)

Returns a new exception that is a copy of this ValidationException's message and userInfo, but whose userInfo dictionary has been augmented with object and key.
Parameters:
object - object on the destination showed by the keypath
key - property of this ValidationException
Returns:
exception giving the related object and the key

exceptionWithObjectAndKey

public NSValidation.ValidationException exceptionWithObjectAndKey(Object object,
                                                                  String key)
Returns a new exception with the same message as this ValidationException, but whose userInfo dictionary contains object 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, ValidatedKeyUserInfoKey, respectively. The exception this method returns has the same message as the original, receiving exception; the only difference is the userInfo dictionary.
Parameters:
object - object on the destination showed by the keypath
key - property of the NSValidation implementor
Returns:
exception giving the related object and the key
See Also:
ValidatedKeyUserInfoKey, ValidatedObjectUserInfoKey

key

public String key()
Returns:
key in this ValidationException's userInfo dictionary for the ValidatedKeyUserInfoKey
See Also:
ValidatedKeyUserInfoKey

object

public Object object()
Returns:
value in this ValidationException's userInfo dictionary for the ValidatedObjectUserInfoKey
See Also:
ValidatedObjectUserInfoKey

userInfo

public NSDictionary userInfo()
Deprecated. Access the individual entries using the key() and object() methods.

Returns:
this ValidationException's userInfo dictionary
See Also:
key(), object()

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.