ERXValidation Class Reference

Collaboration diagram for ERXValidation:

Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static String localizedDisplayNameForKey (EOClassDescription ecd, String key, ERXLocalizer localizer)
static void setPushChangesDefault (boolean val)
static void validationFailedWithException (Throwable e, Object value, String keyPath, NSMutableDictionary errorMessages, String displayPropertyKeyPath, ERXLocalizer localizer, EOEntity entity, boolean pushChanges)
static void validationFailedWithException (Throwable e, Object value, String keyPath, NSMutableDictionary errorMessages, String displayPropertyKeyPath, ERXLocalizer localizer, EOEntity entity)
static void validationFailedWithException (Throwable e, Object value, String keyPath, NSMutableDictionary errorMessages, String displayPropertyKeyPath, ERXLocalizer localizer)

Static Public Attributes

static final boolean DO_NOT_PUSH_INCORRECT_VALUE_ON_EO = false
static final Logger log = Logger.getLogger("er.validation.ERValidation")
static final boolean PUSH_INCORRECT_VALUE_ON_EO = true

Static Private Attributes

static boolean pushChangesDefault = DO_NOT_PUSH_INCORRECT_VALUE_ON_EO


Detailed Description

This is more of a legacy object that was used until we had ERXValidationFactory in place. The only place where this is used is when handling ValidationExceptions that have not been converted by the ERXValidationFactory. This class is also used to handle formatter exceptions that are thrown number formatters in WOComponents.

Member Function Documentation

static String localizedDisplayNameForKey ( EOClassDescription  ecd,
String  key,
ERXLocalizer  localizer 
) [static]

Calculates a localized display name for a given entity and key using the supplied localizer

Parameters:
ecd class description the key belongs to
key to localize
localizer to use for localizing the content
Returns:
the localized display name

static void setPushChangesDefault ( boolean  val  )  [static]

Sets pushing changes onto enterprise objects when a validation exception occurs.

Parameters:
val sets whether incorrect values should be pushed onto an object

static void validationFailedWithException ( Throwable  e,
Object  value,
String  keyPath,
NSMutableDictionary  errorMessages,
String  displayPropertyKeyPath,
ERXLocalizer  localizer,
EOEntity  entity,
boolean  pushChanges 
) [static]

Processes a validation exception to make it look better. The resulting exception message is set in the errorMessages dictionary.

Parameters:
e validation exception.
value that failed validation.
keyPath that failed validation.
errorMessages dictionary to place the formatted message into.
displayPropertyKeyPath key used in the case of the formatter exception to calculate the pretty display name.
localizer to use to localize the exception.
entity that the validation exception is happening too.
pushChanges boolean to flag if the bad values should be pushed onto the eo.

static void validationFailedWithException ( Throwable  e,
Object  value,
String  keyPath,
NSMutableDictionary  errorMessages,
String  displayPropertyKeyPath,
ERXLocalizer  localizer,
EOEntity  entity 
) [static]

Processes a validation exception to make it look better. The resulting exception message is set in the errorMessages dictionary. This method uses the default value for pushing values onto the eo.

Parameters:
e validation exception.
value that failed validation.
keyPath that failed validation.
errorMessages dictionary to place the formatted message into.
displayPropertyKeyPath key used in the case of the formatter exception to calculate the pretty display name.
localizer to use to localize the exception.
entity that the validation exception is happening too.

static void validationFailedWithException ( Throwable  e,
Object  value,
String  keyPath,
NSMutableDictionary  errorMessages,
String  displayPropertyKeyPath,
ERXLocalizer  localizer 
) [static]

Processes a validation exception to make it look better. The resulting exception message is set in the errorMessages dictionary.

Parameters:
e validation exception.
value that failed validation.
keyPath that failed validation.
errorMessages dictionary to place the formatted message into.
displayPropertyKeyPath key used in the case of the formatter exception to calculate the pretty display name.
localizer to use to localize the exception.


Member Data Documentation

final boolean DO_NOT_PUSH_INCORRECT_VALUE_ON_EO = false [static]

holds the static constant for not pushing an incorrect value onto an eo

final Logger log = Logger.getLogger("er.validation.ERValidation") [static]

logging support

final boolean PUSH_INCORRECT_VALUE_ON_EO = true [static]

holds the static constant for pushing an incorrect value onto an eo

holds the default constant for pushing on values onto eos, defaults to false


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:17 2012 for Project Wonder by  doxygen 1.5.8