|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.rice.kns.service.impl.DictionaryValidationServiceImpl
public class DictionaryValidationServiceImpl
Validates Documents, Business Objects, and Attributes against the data dictionary. Including min, max lengths, and validating expressions. This is the default, Kuali delivered implementation. KULRICE - 3355 Modified to prevent infinite looping (to maxDepth) scenario when a parent references a child which references a parent
Field Summary | |
---|---|
static String |
VALIDATE_METHOD
Constant defines a validation method for an attribute value. |
Constructor Summary | |
---|---|
DictionaryValidationServiceImpl()
|
Method Summary | |
---|---|
DataDictionaryService |
getDataDictionaryService()
|
boolean |
isBusinessObjectValid(org.kuali.rice.kns.bo.BusinessObject businessObject)
Encapsulates {@link #validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the
ErrorMap.Validates the business object primitive attributes against the data dictionary. |
boolean |
isBusinessObjectValid(org.kuali.rice.kns.bo.BusinessObject businessObject,
String prefix)
Encapsulates {@link #validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the
ErrorMap.Validates the business object primitive attributes against the data dictionary. |
void |
setBusinessObjectService(BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value. |
void |
setDataDictionaryService(DataDictionaryService dataDictionaryService)
|
void |
setMaintenanceDocumentDictionaryService(MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService)
Sets the maintenanceDocumentDictionaryService attribute value. |
void |
setPersistenceService(PersistenceService persistenceService)
Sets the persistenceService attribute value. |
void |
setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
|
void |
setTransactionalDocumentDictionaryService(TransactionalDocumentDictionaryService transactionalDocumentDictionaryService)
|
boolean |
validateApcRule(org.kuali.rice.kns.bo.BusinessObject bo,
ApcRuleDefinition apcRule)
This method applies a specific rule against the given BusinessObject as defined in the MaintenanceDocument.xml file. |
boolean |
validateApcRules(org.kuali.rice.kns.bo.BusinessObject bo)
This method applies all rules against the given BusinessObject as defined in the MaintenanceDocument.xml file. |
void |
validateAttributeFormat(String objectClassName,
String attributeName,
String attributeInValue,
String errorKey)
Validates an attribute of a given class for proper min, max length, syntax, and required. |
void |
validateAttributeFormat(String objectClassName,
String attributeName,
String attributeInValue,
String attributeDataType,
String errorKey)
The attributeDataType parameter should be one of the data types specified by the SearchableAttribute interface; will default to DATA_TYPE_STRING if a data type other than the ones from SearchableAttribute is specified. |
void |
validateAttributeRequired(String objectClassName,
String attributeName,
Object attributeValue,
Boolean forMaintenance,
String errorKey)
Validates an attribute of a given class for required check. |
void |
validateBusinessObject(org.kuali.rice.kns.bo.BusinessObject businessObject)
Validates the business object primitive attributes against the data dictionary. |
void |
validateBusinessObject(org.kuali.rice.kns.bo.BusinessObject businessObject,
boolean validateRequired)
Validates the business object primitive attributes against the data dictionary. |
void |
validateBusinessObjectOnMaintenanceDocument(org.kuali.rice.kns.bo.BusinessObject businessObject,
String docTypeName)
|
protected void |
validateBusinessObjectOnMaintenanceDocumentHelper(org.kuali.rice.kns.bo.BusinessObject businessObject,
List<? extends MaintainableItemDefinition> itemDefinitions,
String errorPrefix)
|
void |
validateBusinessObjectsRecursively(org.kuali.rice.kns.bo.BusinessObject businessObject,
int depth)
Validates the business object against the dictionary, uses reflection to get any child business objects, and recursively calls back. |
boolean |
validateDefaultExistenceChecks(org.kuali.rice.kns.bo.BusinessObject bo)
This method does an existence check against all references of a BusinessObject as defined in the MaintenanceDocument.xml file for that business object. |
boolean |
validateDefaultExistenceChecksForNewCollectionItem(org.kuali.rice.kns.bo.BusinessObject bo,
org.kuali.rice.kns.bo.BusinessObject newCollectionItem,
String collectionName)
Does an existence check against all references configured as a default existence check in the maintenance document data dictionary file for the given business object Appropriate errors will also be placed in the GlobalVariables.ErrorMap. |
boolean |
validateDefaultExistenceChecksForNewCollectionItem(TransactionalDocument document,
org.kuali.rice.kns.bo.BusinessObject newCollectionItem,
String collectionName)
This overridden method ... |
boolean |
validateDefaultExistenceChecksForTransDoc(TransactionalDocument document)
This overridden method ... |
void |
validateDocument(Document document)
Validates the contents of a document (i.e. |
void |
validateDocumentAndUpdatableReferencesRecursively(Document document,
int maxDepth,
boolean validateRequired)
Validates the contents of a document and recursively validates any of its updatable references |
void |
validateDocumentAndUpdatableReferencesRecursively(Document document,
int maxDepth,
boolean validateRequired,
boolean chompLastLetterSFromCollectionName)
Validates the contents of a document and recursively validates any of its updatable references |
void |
validateDocumentAttribute(Document document,
String attributeName,
String errorPrefix)
Validates the specified attribute of the given document against the data dictionary. |
void |
validateDocumentRecursively(Document document,
int depth)
Validates the contents of a document (i.e. |
void |
validatePrimitiveFromDescriptor(String entryName,
Object object,
PropertyDescriptor propertyDescriptor,
String errorPrefix,
boolean validateRequired)
calls validate format and required check for the given propertyDescriptor |
boolean |
validateReferenceExists(org.kuali.rice.kns.bo.BusinessObject bo,
ReferenceDefinition reference)
This method examines the populated BusinessObject bo instance passed in for a member named by the referenceName. |
boolean |
validateReferenceExists(org.kuali.rice.kns.bo.BusinessObject bo,
String referenceName)
This method examines the populated BusinessObject bo instance passed in for a member named by the referenceName. |
boolean |
validateReferenceExistsAndIsActive(org.kuali.rice.kns.bo.BusinessObject bo,
ReferenceDefinition reference)
This method intelligently tests the designated reference on the bo for both existence and active status, where appropriate. |
boolean |
validateReferenceExistsAndIsActive(org.kuali.rice.kns.bo.BusinessObject bo,
String referenceName,
String attributeToHighlightOnFail,
String displayFieldName)
This method intelligently tests the designated reference on the bo for both existence and active status, where appropriate. |
boolean |
validateReferenceIsActive(org.kuali.rice.kns.bo.BusinessObject bo,
ReferenceDefinition reference)
This method retrieves the reference from the DB, and then tests whether the object is active. |
boolean |
validateReferenceIsActive(org.kuali.rice.kns.bo.BusinessObject bo,
String referenceName)
This method retrieves the reference from the DB, and then tests whether the object is active. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VALIDATE_METHOD
Value is "validate"
Constructor Detail |
---|
public DictionaryValidationServiceImpl()
Method Detail |
---|
public void validateDocument(Document document)
DictionaryValidationService
validateDocument
in interface DictionaryValidationService
document
- - document to validateDictionaryValidationService.validateDocument(org.kuali.rice.kns.document.Document)
public void validateDocumentAttribute(Document document, String attributeName, String errorPrefix)
DictionaryValidationService
validateDocumentAttribute
in interface DictionaryValidationService
DictionaryValidationService.validateDocumentAttribute(org.kuali.rice.kns.document.Document,
java.lang.String,java.lang.String)
public void validateDocumentRecursively(Document document, int depth)
DictionaryValidationService
validateDocumentRecursively
in interface DictionaryValidationService
document
- - document to validatedepth
- - Specify how deep the recrusion should go (0 based). If a negative number is supplied, it's infinite.DictionaryValidationService.validateDocumentRecursively(org.kuali.rice.kns.document.Document, int)
public void validateDocumentAndUpdatableReferencesRecursively(Document document, int maxDepth, boolean validateRequired)
DictionaryValidationService
validateDocumentAndUpdatableReferencesRecursively
in interface DictionaryValidationService
document
- the documentmaxDepth
- the maximum numbers of levels to recursevalidateRequired
- whether to validate whether a field is required and is currently blankpublic void validateDocumentAndUpdatableReferencesRecursively(Document document, int maxDepth, boolean validateRequired, boolean chompLastLetterSFromCollectionName)
DictionaryValidationService
validateDocumentAndUpdatableReferencesRecursively
in interface DictionaryValidationService
document
- the documentmaxDepth
- the maximum numbers of levels to recursevalidateRequired
- whether to validate whether a field is required and is currently blankchompLastLetterSFromCollectionName
- if true, the error path for any collections encountered will have the last "s" removed from the collection name if it ends
with the letter "s". If false, this method acts like DictionaryValidationService.validateDocumentAndUpdatableReferencesRecursively(Document, int, boolean)
public void validateBusinessObject(org.kuali.rice.kns.bo.BusinessObject businessObject)
DictionaryValidationService
validateBusinessObject
in interface DictionaryValidationService
businessObject
- - business object to validateDictionaryValidationService.validateBusinessObject(org.kuali.rice.kns.bo.BusinessObject)
public void validateBusinessObject(org.kuali.rice.kns.bo.BusinessObject businessObject, boolean validateRequired)
DictionaryValidationService
validateBusinessObject
in interface DictionaryValidationService
businessObject
- - business object to validatevalidateRequired
- - whether to execute required field checksDictionaryValidationService.validateBusinessObject(org.kuali.rice.kns.bo.BusinessObject,boolean)
public void validateBusinessObjectOnMaintenanceDocument(org.kuali.rice.kns.bo.BusinessObject businessObject, String docTypeName)
validateBusinessObjectOnMaintenanceDocument
in interface DictionaryValidationService
DictionaryValidationService.validateBusinessObjectOnMaintenanceDocument(org.kuali.rice.kns.bo.BusinessObject, java.lang.String)
protected void validateBusinessObjectOnMaintenanceDocumentHelper(org.kuali.rice.kns.bo.BusinessObject businessObject, List<? extends MaintainableItemDefinition> itemDefinitions, String errorPrefix)
public boolean isBusinessObjectValid(org.kuali.rice.kns.bo.BusinessObject businessObject)
DictionaryValidationService
{@link #validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the
ErrorMap.Validates the business object primitive attributes against the data dictionary. Adds errors to the map as they are
encountered.
Makes no error path adjustments
- Specified by:
isBusinessObjectValid
in interface DictionaryValidationService
- Parameters:
businessObject
- - business object to validate
- Returns:
- boolean validOrNot
- See Also:
DictionaryValidationService.isBusinessObjectValid(org.kuali.rice.kns.bo.BusinessObject)
public boolean isBusinessObjectValid(org.kuali.rice.kns.bo.BusinessObject businessObject, String prefix)
DictionaryValidationService
{@link #validateBusinessObject(BusinessObject) and returns boolean so one doesn't need to check the
ErrorMap.Validates the business object primitive attributes against the data dictionary. Adds errors to the map as they are
encountered.
Makes no error path adjustments
- Specified by:
isBusinessObjectValid
in interface DictionaryValidationService
- Parameters:
businessObject
- - business object to validateprefix
- - error prefix
- Returns:
- boolean valid or not
- See Also:
DictionaryValidationService.isBusinessObjectValid(org.kuali.rice.kns.bo.BusinessObject, String)
public void validateBusinessObjectsRecursively(org.kuali.rice.kns.bo.BusinessObject businessObject, int depth)
DictionaryValidationService
validateBusinessObjectsRecursively
in interface DictionaryValidationService
businessObject
- - business object to validatedepth
- - Specify how deep the recrusion should go (0 based). If a negative number is supplied, it's infinite.public void validateAttributeFormat(String objectClassName, String attributeName, String attributeInValue, String errorKey)
DictionaryValidationService
validateAttributeFormat
in interface DictionaryValidationService
objectClassName
- - name of the dd entryattributeName
- - name of attribute in the bo classattributeInValue
- - current value to validateerrorKey
- - key to place the errors underobjectClassName is the docTypeName
public void validateAttributeFormat(String objectClassName, String attributeName, String attributeInValue, String attributeDataType, String errorKey)
validateAttributeFormat
in interface DictionaryValidationService
objectClassName
- - name of the dd entryattributeName
- - name of attribute in the bo classattributeInValue
- - current value to validateattributeDataType
- - data type that this attribute should be treated as for validation purposeserrorKey
- - key to place the errors underobjectClassName is the docTypeName
public void validateAttributeRequired(String objectClassName, String attributeName, Object attributeValue, Boolean forMaintenance, String errorKey)
DictionaryValidationService
validateAttributeRequired
in interface DictionaryValidationService
objectClassName
- - name of the dd entryattributeName
- - name of attribute in the bo classattributeValue
- - current value to validateerrorKey
- - key to place to errors underDictionaryValidationService.validateAttributeRequired(java.lang.String, java.lang.String, java.lang.Object, java.lang.Boolean, java.lang.String)
public void validatePrimitiveFromDescriptor(String entryName, Object object, PropertyDescriptor propertyDescriptor, String errorPrefix, boolean validateRequired)
validatePrimitiveFromDescriptor
in interface DictionaryValidationService
entryName
- object
- propertyDescriptor
- errorPrefix
- public boolean validateReferenceExists(org.kuali.rice.kns.bo.BusinessObject bo, ReferenceDefinition reference)
DictionaryValidationService
validateReferenceExists
in interface DictionaryValidationService
bo
- - The bo whose reference is being tested.reference
- - The ReferenceDefinition to be existence tested.
DictionaryValidationService.validateReferenceExists(org.kuali.rice.kns.bo.BusinessObject,
org.kuali.rice.kns.datadictionary.ReferenceDefinition)
public boolean validateReferenceExists(org.kuali.rice.kns.bo.BusinessObject bo, String referenceName)
DictionaryValidationService
validateReferenceExists
in interface DictionaryValidationService
bo
- - The bo whose reference is being tested.referenceName
- - The name of the member to be existence tested.
DictionaryValidationService.validateReferenceExists(org.kuali.rice.kns.bo.BusinessObject,
java.lang.String)
public boolean validateReferenceIsActive(org.kuali.rice.kns.bo.BusinessObject bo, ReferenceDefinition reference)
DictionaryValidationService
validateReferenceIsActive
in interface DictionaryValidationService
DictionaryValidationService.validateReferenceIsActive(org.kuali.rice.kns.bo.BusinessObject,
org.kuali.rice.kns.datadictionary.ReferenceDefinition)
public boolean validateReferenceIsActive(org.kuali.rice.kns.bo.BusinessObject bo, String referenceName)
DictionaryValidationService
validateReferenceIsActive
in interface DictionaryValidationService
org.kuali.rice.kns.service.DictionaryValidationService#validateReferenceIsActive(org.kuali.rice.kns.bo.BusinessObject,
java.lang.String, java.lang.String, boolean)
public boolean validateReferenceExistsAndIsActive(org.kuali.rice.kns.bo.BusinessObject bo, ReferenceDefinition reference)
DictionaryValidationService
validateReferenceExistsAndIsActive
in interface DictionaryValidationService
bo
- - the BusinessObject instance to be tested.reference
- - the ReferenceDefinition to control the nature of the testing.
DictionaryValidationService.validateReferenceExistsAndIsActive(org.kuali.rice.kns.bo.BusinessObject,
org.kuali.rice.kns.datadictionary.ReferenceDefinition)
public boolean validateReferenceExistsAndIsActive(org.kuali.rice.kns.bo.BusinessObject bo, String referenceName, String attributeToHighlightOnFail, String displayFieldName)
DictionaryValidationService
validateReferenceExistsAndIsActive
in interface DictionaryValidationService
bo
- - the BusinessObject instance to be tested.referenceName
- - the member name on the bo to be tested for existence and active-stateattributeToHighlightOnFail
- - the fieldName to highlight with the error message on a failuredisplayFieldName
- - the human-readable display name of the failed field, to go in the error message
org.kuali.rice.kns.service.DictionaryValidationService#validateReferenceExistsAndIsActive(org.kuali.rice.kns.bo.BusinessObject,
java.lang.String, java.lang.String, boolean, boolean, java.lang.String, java.lang.String)
public boolean validateDefaultExistenceChecks(org.kuali.rice.kns.bo.BusinessObject bo)
DictionaryValidationService
validateDefaultExistenceChecks
in interface DictionaryValidationService
bo
- - BusinessObject instance that should be tested
DictionaryValidationService.validateDefaultExistenceChecks(org.kuali.rice.kns.bo.BusinessObject)
public boolean validateDefaultExistenceChecksForNewCollectionItem(org.kuali.rice.kns.bo.BusinessObject bo, org.kuali.rice.kns.bo.BusinessObject newCollectionItem, String collectionName)
DictionaryValidationService
validateDefaultExistenceChecksForNewCollectionItem
in interface DictionaryValidationService
bo
- parent business object instance to retrieve default checks fornewCollectionItem
- new collection line to validatecollectionName
- name of the collection in the parent
DictionaryValidationService.validateDefaultExistenceChecksForNewCollectionItem(org.kuali.rice.kns.bo.BusinessObject, org.kuali.rice.kns.bo.BusinessObject, java.lang.String)
public boolean validateDefaultExistenceChecksForTransDoc(TransactionalDocument document)
validateDefaultExistenceChecksForTransDoc
in interface DictionaryValidationService
DictionaryValidationService.validateDefaultExistenceChecksForTransDoc(org.kuali.rice.kns.document.TransactionalDocument)
public boolean validateDefaultExistenceChecksForNewCollectionItem(TransactionalDocument document, org.kuali.rice.kns.bo.BusinessObject newCollectionItem, String collectionName)
validateDefaultExistenceChecksForNewCollectionItem
in interface DictionaryValidationService
newCollectionItem
- that should be testedcollectionName
- that should be tested
org.kuali.rice.kns.service.DictionaryValidationService#validateDefaultExistenceChecksForNewCollectionItem(org.kuali.rice.kns.document.TransactionalDocument, org.kuali.rice.kns.bo.PersistableBusinessObject)
public boolean validateApcRule(org.kuali.rice.kns.bo.BusinessObject bo, ApcRuleDefinition apcRule)
DictionaryValidationService
validateApcRule
in interface DictionaryValidationService
DictionaryValidationService.validateApcRule(org.kuali.rice.kns.bo.BusinessObject,
org.kuali.rice.kns.datadictionary.ApcRuleDefinition)
public boolean validateApcRules(org.kuali.rice.kns.bo.BusinessObject bo)
DictionaryValidationService
validateApcRules
in interface DictionaryValidationService
DictionaryValidationService.validateApcRules(org.kuali.rice.kns.bo.BusinessObject)
public DataDictionaryService getDataDictionaryService()
public void setDataDictionaryService(DataDictionaryService dataDictionaryService)
dataDictionaryService
- The dataDictionaryService to set.public void setBusinessObjectService(BusinessObjectService businessObjectService)
businessObjectService
- The businessObjectService to set.public void setMaintenanceDocumentDictionaryService(MaintenanceDocumentDictionaryService maintenanceDocumentDictionaryService)
maintenanceDocumentDictionaryService
- The maintenanceDocumentDictionaryService to set.public void setTransactionalDocumentDictionaryService(TransactionalDocumentDictionaryService transactionalDocumentDictionaryService)
transactionalDocumentDictionaryService
- the transactionalDocumentDictionaryService to setpublic void setPersistenceService(PersistenceService persistenceService)
persistenceService
- The persistenceService to set.public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |