Project Wonder 2.0

er.extensions
Class ERXValidation

java.lang.Object
  extended byer.extensions.ERXValidation

public class ERXValidation
extends 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 ERXLogger 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 void setPushChangesDefault(boolean val)
          Sets pushing changes onto enterprise objects when a validation exception occurs.
static void validationFailedWithException(Throwable e, Object value, String keyPath, NSMutableDictionary errorMessages, String displayPropertyKeyPath, ERXLocalizer localizer)
          Processes a validation exception to make it look better.
static void validationFailedWithException(Throwable e, Object value, String keyPath, NSMutableDictionary errorMessages, String displayPropertyKeyPath, ERXLocalizer localizer, EOEntity entity)
          Processes a validation exception to make it look better.
static void validationFailedWithException(Throwable e, Object value, String keyPath, NSMutableDictionary errorMessages, String displayPropertyKeyPath, ERXLocalizer localizer, 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 ERXLogger 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(Throwable e,
                                                 Object value,
                                                 String keyPath,
                                                 NSMutableDictionary errorMessages,
                                                 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(Throwable e,
                                                 Object value,
                                                 String keyPath,
                                                 NSMutableDictionary errorMessages,
                                                 String displayPropertyKeyPath,
                                                 ERXLocalizer localizer,
                                                 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(Throwable e,
                                                 Object value,
                                                 String keyPath,
                                                 NSMutableDictionary errorMessages,
                                                 String displayPropertyKeyPath,
                                                 ERXLocalizer localizer,
                                                 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.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.