| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.rules.fieldvalidators.AbstractFieldValidator
org.jaffa.rules.fieldvalidators.GenericForeignKeyFieldValidator
This validates a field against a set of valid values for that field, as listed in a database table For eg. Lets assume that there is database table 'VALID_FIELD_VALUE' which holds a set of valid values for certain fields in the system. The structure of this table 'VALID_FIELD_VALUE' in oracle can be like - TABLE_NAME NOT NULL VARCHAR2(20) FIELD_NAME NOT NULL VARCHAR2(30) LEGAL_VALUE NOT NULL VARCHAR2(20) This table can hold values like - TABLE_NAME FIELD_NAME LEGAL_VALUE ========== ========== =========== USER DEPARTMENT ACCOUNTS USER DEPARTMENT ENGINEERING USER DEPARTMENT PERSONNEL ITEM TYPE CONSUMABLE ITEM TYPE NON-CONSUMABLE This way, the table can hold valid values for the different fields The generic implementation provides the ValidFieldValue domain class and its mapping file. Tweak its mapping file to map it to the correct table and fields. Or specify your own domain class. The GenericForeignKeyFieldValidator definition in validators.xml requires the appropriate values to be passed in parameters.
| Constructor Summary | |
| GenericForeignKeyFieldValidator() | |
| Method Summary | |
|  String | getDomainClassName()Getter for property domainClassName. | 
|  String | getFieldName()Getter for property fieldName. | 
|  String | getFieldNameForField()Getter for property fieldNameForField. | 
|  String | getFieldNameForTable()Getter for property fieldNameForTable. | 
|  String | getFieldNameForValue()Getter for property fieldNameForValue. | 
|  String | getTableName()Getter for property tableName. | 
|  void | setDomainClassName(String domainClassName)Setter for property domainClassName. | 
|  void | setFieldName(String fieldName)Setter for property fieldName. | 
|  void | setFieldNameForField(String fieldNameForField)Setter for property fieldNameForField. | 
|  void | setFieldNameForTable(String fieldNameForTable)Setter for property fieldNameForTable. | 
|  void | setFieldNameForValue(String fieldNameForValue)Setter for property fieldNameForValue. | 
|  void | setTableName(String tableName)Setter for property tableName. | 
|  void | validate()The RulesEngine will invoke this method to perform the field validation. | 
| Methods inherited from class org.jaffa.rules.fieldvalidators.AbstractFieldValidator | 
| cleanup, getLabelToken, getUow, getValue, init, setLabelToken, setUow, setValue | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public GenericForeignKeyFieldValidator()
| Method Detail | 
public String getDomainClassName()
public void setDomainClassName(String domainClassName)
domainClassName - New value of property domainClassName.public String getFieldNameForTable()
public void setFieldNameForTable(String fieldNameForTable)
fieldNameForTable - New value of property fieldNameForTable.public String getFieldNameForField()
public void setFieldNameForField(String fieldNameForField)
fieldNameForField - New value of property fieldNameForField.public String getFieldNameForValue()
public void setFieldNameForValue(String fieldNameForValue)
fieldNameForValue - New value of property fieldNameForValue.public String getTableName()
public void setTableName(String tableName)
tableName - New value of property tableName.public String getFieldName()
public void setFieldName(String fieldName)
fieldName - New value of property fieldName.
public void validate()
              throws ValidationException,
                     FrameworkException
validate in interface IFieldValidatorvalidate in class AbstractFieldValidatorValidationException - if any validation rule fails.
FrameworkException - if any framework error occurs.| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||