Project Wonder 5.0

er.extensions.validation
Class ERXValidation

java.lang.Object
  extended by er.extensions.validation.ERXValidation

public class ERXValidation
extends java.lang.Object

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.


Field Summary
static boolean DO_NOT_PUSH_INCORRECT_VALUE_ON_EO
          holds the static constant for not pushing an incorrect value onto an eo
static org.apache.log4j.Logger log
          logging support
static boolean PUSH_INCORRECT_VALUE_ON_EO
          holds the static constant for pushing an incorrect value onto an eo
 
Constructor Summary
ERXValidation()
           
 
Method Summary
static java.lang.String localizedDisplayNameForKey(com.webobjects.eocontrol.EOClassDescription ecd, java.lang.String key, ERXLocalizer localizer)
          Calculates a localized display name for a given entity and key using the supplied localizer
static void setPushChangesDefault(boolean val)
          Sets pushing changes onto enterprise objects when a validation exception occurs.
static void validationFailedWithException(java.lang.Throwable e, java.lang.Object value, java.lang.String keyPath, com.webobjects.foundation.NSMutableDictionary errorMessages, java.lang.String displayPropertyKeyPath, ERXLocalizer localizer)
          Processes a validation exception to make it look better.
static void validationFailedWithException(java.lang.Throwable e, java.lang.Object value, java.lang.String keyPath, com.webobjects.foundation.NSMutableDictionary errorMessages, java.lang.String displayPropertyKeyPath, ERXLocalizer localizer, com.webobjects.eoaccess.EOEntity entity)
          Processes a validation exception to make it look better.
static void validationFailedWithException(java.lang.Throwable e, java.lang.Object value, java.lang.String keyPath, com.webobjects.foundation.NSMutableDictionary errorMessages, java.lang.String displayPropertyKeyPath, ERXLocalizer localizer, com.webobjects.eoaccess.EOEntity entity, boolean pushChanges)
          Processes a validation exception to make it look better.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
logging support


PUSH_INCORRECT_VALUE_ON_EO

public static final boolean PUSH_INCORRECT_VALUE_ON_EO
holds the static constant for pushing an incorrect value onto an eo

See Also:
Constant Field Values

DO_NOT_PUSH_INCORRECT_VALUE_ON_EO

public static final boolean DO_NOT_PUSH_INCORRECT_VALUE_ON_EO
holds the static constant for not pushing an incorrect value onto an eo

See Also:
Constant Field Values
Constructor Detail

ERXValidation

public ERXValidation()
Method Detail

setPushChangesDefault

public static void setPushChangesDefault(boolean val)
Sets pushing changes onto enterprise objects when a validation exception occurs.

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

validationFailedWithException

public static void validationFailedWithException(java.lang.Throwable e,
                                                 java.lang.Object value,
                                                 java.lang.String keyPath,
                                                 com.webobjects.foundation.NSMutableDictionary errorMessages,
                                                 java.lang.String displayPropertyKeyPath,
                                                 ERXLocalizer localizer)
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.

validationFailedWithException

public static void validationFailedWithException(java.lang.Throwable e,
                                                 java.lang.Object value,
                                                 java.lang.String keyPath,
                                                 com.webobjects.foundation.NSMutableDictionary errorMessages,
                                                 java.lang.String displayPropertyKeyPath,
                                                 ERXLocalizer localizer,
                                                 com.webobjects.eoaccess.EOEntity entity)
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.

validationFailedWithException

public static void validationFailedWithException(java.lang.Throwable e,
                                                 java.lang.Object value,
                                                 java.lang.String keyPath,
                                                 com.webobjects.foundation.NSMutableDictionary errorMessages,
                                                 java.lang.String displayPropertyKeyPath,
                                                 ERXLocalizer localizer,
                                                 com.webobjects.eoaccess.EOEntity entity,
                                                 boolean pushChanges)
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.

localizedDisplayNameForKey

public static java.lang.String localizedDisplayNameForKey(com.webobjects.eocontrol.EOClassDescription ecd,
                                                          java.lang.String key,
                                                          ERXLocalizer localizer)
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

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.