WebObjects 5.4.2

com.webobjects.foundation
Class NSValidation.ValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.webobjects.foundation.NSValidation.ValidationException
All Implemented Interfaces:
Serializable
Enclosing interface:
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 NSValidation.ValidationException.additionalExceptions()
static String ValidatedKeyUserInfoKey
          Deprecated. Use NSValidation.ValidationException.key()
static String ValidatedObjectUserInfoKey
          Deprecated. User NSValidation.ValidationException.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.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 NSValidation.ValidationException.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 NSValidation.ValidationException.key() and NSValidation.ValidationException.object() methods.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ValidatedObjectUserInfoKey

@Deprecated
public static final String ValidatedObjectUserInfoKey
Deprecated. User NSValidation.ValidationException.object()
A key for an entry in the exception's user info dictionary. The entry contains the object that failed to validate.

See Also:
Constant Field Values

ValidatedKeyUserInfoKey

@Deprecated
public static final String ValidatedKeyUserInfoKey
Deprecated. Use NSValidation.ValidationException.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.

See Also:
Constant Field Values

AdditionalExceptionsKey

@Deprecated
public static final String AdditionalExceptionsKey
Deprecated. Use NSValidation.ValidationException.additionalExceptions()
The key for an entry in the exception's user info dictionary that contains subexceptions.

See Also:
Constant Field Values
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:
NSValidation.ValidationException.object(), NSValidation.ValidationException.key()

NSValidation.ValidationException

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

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

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:
NSValidation.ValidationException.AdditionalExceptionsKey

object

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

key

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

additionalExceptions

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

Returns:
corresponding array in the userinfo dictionary.

userInfo

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

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

exceptionAddingEntriesToUserInfo

@Deprecated
public NSValidation.ValidationException exceptionAddingEntriesToUserInfo(Object object,
                                                                                    String key)
Deprecated. Use NSValidation.ValidationException.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:
NSValidation.ValidationException.ValidatedKeyUserInfoKey, NSValidation.ValidationException.ValidatedObjectUserInfoKey

Last updated June 2008

Copyright © 2000-2008 Apple Inc.