Project Wonder 2.0

com.gammastream.validity
Class GSVEngine

java.lang.Object
  extended bycom.gammastream.validity.GSVEngine

public final class GSVEngine
extends Object

This is Validity's validation engine. This class loads and applies the rules you have modeled in your Validity model file. This class is accessed via a singleton accessor.

Author:
GammaStream Technologies, Inc.

Field Summary
static String ERROR_DICTIONARY_KEY
          Key used to access the Validity exception dictionary from NSValidation.Exception's userinfo dictionary.
 
Method Summary
 boolean checkRule(GSVRule rule, String attributeName, NSMutableDictionary errorDict, Object eoObject, int when)
          May be called arbitrarily to validate an EO Object, though it is explicitly called by validateObject Returns true if all validation succeeds.
 boolean checkRule(GSVRule rule, String attributeName, NSMutableDictionary errorDict, String value, int when)
           
static NSValidation.ValidationException exceptionByAppendingErrorToException(String errorMessage, String key, NSValidation.ValidationException ex)
           
static GSVEngine sharedValidationEngine()
          Creates a new GSVEngine if one is not already created, and returns the shared instance.
 boolean validateAttribute(Object object, String attributeName, GSVRule rule)
          May be called arbitrarily to validate an object Returns true if all validation succeeds.
 boolean validateEOObject(EOEnterpriseObject eoObject, int when)
          May be called arbitrarily to validate and eo object Returns true if all validation succeeds.
 boolean validateEOObjectOnDelete(EOEnterpriseObject eoObject)
          Called from an object being validated (i.e. validateForDelete());
 boolean validateEOObjectOnInsert(EOEnterpriseObject eoObject)
          Called from an object being validated (i.e. validateForInsert());
 boolean validateEOObjectOnSave(EOEnterpriseObject eoObject)
          Called from an object being validated (i.e. validateForSave());
 boolean validateEOObjectOnUpdate(EOEnterpriseObject eoObject)
          Called from an object being validated (i.e. validateForUpdate());
 NSDictionary validateKeyAndValueInEntity(String key, String value, String entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_DICTIONARY_KEY

public static String ERROR_DICTIONARY_KEY
Key used to access the Validity exception dictionary from NSValidation.Exception's userinfo dictionary.

Method Detail

sharedValidationEngine

public static GSVEngine sharedValidationEngine()
Creates a new GSVEngine if one is not already created, and returns the shared instance.

Returns:
The shared validation engine.

exceptionByAppendingErrorToException

public static NSValidation.ValidationException exceptionByAppendingErrorToException(String errorMessage,
                                                                                    String key,
                                                                                    NSValidation.ValidationException ex)

validateEOObjectOnSave

public boolean validateEOObjectOnSave(EOEnterpriseObject eoObject)
Called from an object being validated (i.e. validateForSave());


validateEOObjectOnInsert

public boolean validateEOObjectOnInsert(EOEnterpriseObject eoObject)
Called from an object being validated (i.e. validateForInsert());


validateEOObjectOnUpdate

public boolean validateEOObjectOnUpdate(EOEnterpriseObject eoObject)
Called from an object being validated (i.e. validateForUpdate());


validateEOObjectOnDelete

public boolean validateEOObjectOnDelete(EOEnterpriseObject eoObject)
Called from an object being validated (i.e. validateForDelete());


validateKeyAndValueInEntity

public NSDictionary validateKeyAndValueInEntity(String key,
                                                String value,
                                                String entity)

validateEOObject

public boolean validateEOObject(EOEnterpriseObject eoObject,
                                int when)
May be called arbitrarily to validate and eo object Returns true if all validation succeeds. Throws an NSValidation.ValidationException if one or more of the rules fails.


validateAttribute

public boolean validateAttribute(Object object,
                                 String attributeName,
                                 GSVRule rule)
May be called arbitrarily to validate an object Returns true if all validation succeeds. Throws an NSValidation.ValidationException if one or more of the rules fails.


checkRule

public boolean checkRule(GSVRule rule,
                         String attributeName,
                         NSMutableDictionary errorDict,
                         String value,
                         int when)

checkRule

public boolean checkRule(GSVRule rule,
                         String attributeName,
                         NSMutableDictionary errorDict,
                         Object eoObject,
                         int when)
May be called arbitrarily to validate an EO Object, though it is explicitly called by validateObject Returns true if all validation succeeds. Returns false if the rule fails, and populates the error dictionary with the error.


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

Copyright © 2002 – 2004 Project Wonder.