public class DictionaryValidationServiceImpl extends Object implements DictionaryValidationService
| Modifier and Type | Field and Description |
|---|---|
protected DataDictionaryService |
dataDictionaryService |
protected DocumentDictionaryService |
documentDictionaryService |
static String |
VALIDATE_METHOD
Constant defines a validation method for an attribute value.
|
| Constructor and Description |
|---|
DictionaryValidationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
List<CollectionConstraintProcessor> |
getCollectionConstraintProcessors()
gets the list of
CollectionConstraintProcessor |
List<ConstraintProvider> |
getConstraintProviders()
gets the list of
ConstraintProviders |
DataDictionaryService |
getDataDictionaryService()
gets the
DataDictionaryService |
DocumentDictionaryService |
getDocumentDictionaryService()
gets the locally saved instance of @{link DocumentDictionaryService}
|
List<ConstraintProcessor> |
getElementConstraintProcessors()
gets the list of element
ConstraintProcessor |
LegacyDataAdapter |
getLegacyDataAdapter()
Deprecated.
|
boolean |
isBusinessObjectValid(Object businessObject) |
boolean |
isBusinessObjectValid(Object businessObject,
String prefix) |
protected Set<Object> |
newIdentitySet()
creates a new IdentitySet.
|
protected void |
processCollectionConstraints(DictionaryValidationResult result,
Collection<?> collection,
Constrainable definition,
AttributeValueReader attributeValueReader,
boolean doOptionalProcessing,
String validationState,
StateMapping stateMapping)
process constraints for the provided collection using the collection constraint processors
|
protected void |
processElementConstraints(DictionaryValidationResult result,
Object value,
Constrainable definition,
AttributeValueReader attributeValueReader,
boolean doOptionalProcessing,
String validationState,
StateMapping stateMapping)
process constraints for the provided value using the element constraint processors
|
void |
setCollectionConstraintProcessors(List<CollectionConstraintProcessor> collectionConstraintProcessors)
sets the list of
CollectionConstraintProcessor |
void |
setConstraintProviders(List<ConstraintProvider> constraintProviders)
sets a list of
ConstraintProvider |
void |
setDataDictionaryService(DataDictionaryService dataDictionaryService)
sets the
DataDictionaryService |
void |
setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
sets the
DocumentDictionaryService |
void |
setElementConstraintProcessors(List<ConstraintProcessor> elementConstraintProcessors)
sets the list of
ConstraintProcessor |
DictionaryValidationResult |
validate(AttributeValueReader valueReader,
boolean doOptionalProcessing,
String validationState,
StateMapping stateMapping)
Validates using the defined AttributeValueReader (which allows access the object being validated) against
the validationState and stateMapping (if specified).
|
DictionaryValidationResult |
validate(Object object) |
DictionaryValidationResult |
validate(Object object,
String entryName,
DataDictionaryEntry entry,
boolean doOptionalProcessing) |
DictionaryValidationResult |
validate(Object object,
String entryName,
String attributeName,
boolean doOptionalProcessing) |
DictionaryValidationResult |
validateAgainstNextState(Object object) |
DictionaryValidationResult |
validateAgainstState(Object object,
String validationState) |
protected void |
validateAttribute(DictionaryValidationResult result,
AttributeValueReader attributeValueReader,
boolean checkIfRequired,
String validationState,
StateMapping stateMapping)
validates an attribute
|
protected void |
validateAttribute(DictionaryValidationResult result,
Constrainable definition,
AttributeValueReader attributeValueReader,
boolean checkIfRequired,
String validationState,
StateMapping stateMapping)
Validates the attribute specified by definition
|
void |
validateBusinessObject(Object businessObject) |
void |
validateBusinessObject(Object businessObject,
boolean validateRequired) |
protected void |
validateBusinessObjectsFromDescriptors(Object object,
PropertyDescriptor[] propertyDescriptors,
int depth)
iterates through the property descriptors looking for business objects or lists of business objects.
|
void |
validateBusinessObjectsRecursively(Object businessObject,
int depth) |
boolean |
validateDefaultExistenceChecks(Object dataObject) |
boolean |
validateDefaultExistenceChecksForNewCollectionItem(Object dataObject,
Object newCollectionItem,
String collectionName) |
boolean |
validateDefaultExistenceChecksForNewCollectionItem(TransactionalDocument document,
Object newCollectionItem,
String collectionName) |
boolean |
validateDefaultExistenceChecksForTransDoc(TransactionalDocument document) |
void |
validateDocument(Document document) |
void |
validateDocumentAndUpdatableReferencesRecursively(Document document,
int maxDepth,
boolean validateRequired) |
void |
validateDocumentAndUpdatableReferencesRecursively(Document document,
int maxDepth,
boolean validateRequired,
boolean chompLastLetterSFromCollectionName) |
void |
validateDocumentAttribute(Document document,
String attributeName,
String errorPrefix) |
protected void |
validateObject(DictionaryValidationResult result,
AttributeValueReader attributeValueReader,
boolean doOptionalProcessing,
boolean processAttributes,
String validationState,
StateMapping stateMapping)
validates an object and its attributes recursively
|
void |
validatePrimitiveFromDescriptor(String entryName,
Object object,
PropertyDescriptor propertyDescriptor,
String errorPrefix,
boolean validateRequired)
Deprecated.
since 1.1
|
boolean |
validateReferenceExists(Object dataObject,
ReferenceDefinition reference) |
boolean |
validateReferenceExists(Object dataObject,
String referenceName) |
boolean |
validateReferenceExistsAndIsActive(Object dataObject,
ReferenceDefinition reference) |
boolean |
validateReferenceExistsAndIsActive(Object dataObject,
String referenceName,
String attributeToHighlightOnFail,
String displayFieldName) |
boolean |
validateReferenceIsActive(Object dataObject,
ReferenceDefinition reference) |
boolean |
validateReferenceIsActive(Object dataObject,
String referenceName) |
protected void |
validateUpdatabableReferencesRecursively(Object businessObject,
int maxDepth,
boolean validateRequired,
boolean chompLastLetterSFromCollectionName,
Set<Object> processedBOs) |
public static final String VALIDATE_METHOD
Value is "validate"
protected DataDictionaryService dataDictionaryService
protected DocumentDictionaryService documentDictionaryService
public DictionaryValidationServiceImpl()
protected final Set<Object> newIdentitySet()
public DictionaryValidationResult validate(Object object)
validate in interface DictionaryValidationServiceDictionaryValidationService.validate(java.lang.Object)public DictionaryValidationResult validate(Object object, String entryName, String attributeName, boolean doOptionalProcessing)
validate in interface DictionaryValidationServiceDictionaryValidationService.validate(java.lang.Object, java.lang.String,
java.lang.String, boolean)public DictionaryValidationResult validateAgainstNextState(Object object)
validateAgainstNextState in interface DictionaryValidationServiceDictionaryValidationService.validateAgainstNextState(Object)public DictionaryValidationResult validateAgainstState(Object object, String validationState)
validateAgainstState in interface DictionaryValidationServiceDictionaryValidationService.validateAgainstState(Object, String)public DictionaryValidationResult validate(Object object, String entryName, DataDictionaryEntry entry, boolean doOptionalProcessing)
validate in interface DictionaryValidationServiceDictionaryValidationService.validate(Object, String, DataDictionaryEntry, boolean)public void validateDocument(Document document)
validateDocument in interface DictionaryValidationServiceDictionaryValidationService.validateDocument(org.kuali.rice.krad.document.Document)public void validateDocumentAttribute(Document document, String attributeName, String errorPrefix)
public void validateDocumentAndUpdatableReferencesRecursively(Document document, int maxDepth, boolean validateRequired)
public void validateDocumentAndUpdatableReferencesRecursively(Document document, int maxDepth, boolean validateRequired, boolean chompLastLetterSFromCollectionName)
protected void validateUpdatabableReferencesRecursively(Object businessObject, int maxDepth, boolean validateRequired, boolean chompLastLetterSFromCollectionName, Set<Object> processedBOs)
public boolean isBusinessObjectValid(Object businessObject)
isBusinessObjectValid in interface DictionaryValidationServiceorg.kuali.rice.krad.service.DictionaryValidationService#isBusinessObjectValid(org.kuali.rice.krad.bo.BusinessObject)public boolean isBusinessObjectValid(Object businessObject, String prefix)
isBusinessObjectValid in interface DictionaryValidationServiceorg.kuali.rice.krad.service.DictionaryValidationService#isBusinessObjectValid(org.kuali.rice.krad.bo.BusinessObject,
String)public void validateBusinessObjectsRecursively(Object businessObject, int depth)
businessObject - - business object to validatepublic void validateBusinessObject(Object businessObject)
validateBusinessObject in interface DictionaryValidationServiceorg.kuali.rice.krad.service.DictionaryValidationService#validateBusinessObject(org.kuali.rice.krad.bo.BusinessObject)public void validateBusinessObject(Object businessObject, boolean validateRequired)
validateBusinessObject in interface DictionaryValidationServiceorg.kuali.rice.krad.service.DictionaryValidationService#validateBusinessObject(org.kuali.rice.krad.bo.BusinessObject,
boolean)protected void validateBusinessObjectsFromDescriptors(Object object, PropertyDescriptor[] propertyDescriptors, int depth)
object - propertyDescriptors - @Deprecated public void validatePrimitiveFromDescriptor(String entryName, Object object, PropertyDescriptor propertyDescriptor, String errorPrefix, boolean validateRequired)
validatePrimitiveFromDescriptor in interface DictionaryValidationServiceentryName - object - propertyDescriptor - errorPrefix - public boolean validateReferenceExists(Object dataObject, ReferenceDefinition reference)
public boolean validateReferenceExists(Object dataObject, String referenceName)
validateReferenceExists in interface DictionaryValidationServiceDictionaryValidationService.validateReferenceExists(java.lang.Object dataObject,
java.lang.String)public boolean validateReferenceIsActive(Object dataObject, ReferenceDefinition reference)
public boolean validateReferenceIsActive(Object dataObject, String referenceName)
validateReferenceIsActive in interface DictionaryValidationServiceDictionaryValidationService.validateReferenceIsActive(java.lang.Object
dataObject,
String)public boolean validateReferenceExistsAndIsActive(Object dataObject, ReferenceDefinition reference)
public boolean validateReferenceExistsAndIsActive(Object dataObject, String referenceName, String attributeToHighlightOnFail, String displayFieldName)
public boolean validateDefaultExistenceChecks(Object dataObject)
validateDefaultExistenceChecks in interface DictionaryValidationServiceDictionaryValidationService.validateDefaultExistenceChecks(java.lang.Object
dataObject)public boolean validateDefaultExistenceChecksForNewCollectionItem(Object dataObject, Object newCollectionItem, String collectionName)
public boolean validateDefaultExistenceChecksForTransDoc(TransactionalDocument document)
public boolean validateDefaultExistenceChecksForNewCollectionItem(TransactionalDocument document, Object newCollectionItem, String collectionName)
validateDefaultExistenceChecksForNewCollectionItem in interface DictionaryValidationServiceorg.kuali.rice.krad.service.DictionaryValidationService#validateDefaultExistenceChecksForNewCollectionItem(org.kuali.rice.krad.document.TransactionalDocument,
org.kuali.rice.krad.bo.BusinessObject, String)public DictionaryValidationResult validate(AttributeValueReader valueReader, boolean doOptionalProcessing, String validationState, StateMapping stateMapping)
If state information is null, validates the constraints as stateless (ie all constraints apply regardless of their states attribute).
validate in interface DictionaryValidationServicevalueReader - - an object to validatedoOptionalProcessing - true if the validation should do optional validation (e.g. to check if empty values
are required or not), false otherwisevalidationState - stateMapping - protected void processElementConstraints(DictionaryValidationResult result, Object value, Constrainable definition, AttributeValueReader attributeValueReader, boolean doOptionalProcessing, String validationState, StateMapping stateMapping)
result - - used to store the validation resultsvalue - - the object on which constraints are to be processed - the value of a complex attributedefinition - - a Data Dictionary definition e.g. ComplexAttributeDefinitionattributeValueReader - - a class that encapsulate access to both dictionary metadata and object field
valuesdoOptionalProcessing - - true if the validation should do optional validation, false otherwiseprotected void processCollectionConstraints(DictionaryValidationResult result, Collection<?> collection, Constrainable definition, AttributeValueReader attributeValueReader, boolean doOptionalProcessing, String validationState, StateMapping stateMapping)
result - - used to store the validation resultscollection - - the object on which constraints are to be processed - a collectiondefinition - - a Data Dictionary definition e.g. CollectionDefinitionattributeValueReader - - a class that encapsulate access to both dictionary metadata and object field
valuesdoOptionalProcessing - - true if the validation should do optional validation, false otherwiseprotected void validateAttribute(DictionaryValidationResult result, AttributeValueReader attributeValueReader, boolean checkIfRequired, String validationState, StateMapping stateMapping) throws AttributeValidationException
result - - used to store the validation resultsattributeValueReader - - a class that encapsulate access to both dictionary metadata and object field
valuescheckIfRequired - - check if empty values are required or notAttributeValidationExceptionprotected void validateAttribute(DictionaryValidationResult result, Constrainable definition, AttributeValueReader attributeValueReader, boolean checkIfRequired, String validationState, StateMapping stateMapping) throws AttributeValidationException
definition - - the constrainable attribute definition of a specific attribute nameAttributeValidationExceptionprotected void validateObject(DictionaryValidationResult result, AttributeValueReader attributeValueReader, boolean doOptionalProcessing, boolean processAttributes, String validationState, StateMapping stateMapping) throws AttributeValidationException
result - - used to store the validation resultsattributeValueReader - - a class that encapsulate access to both dictionary metadata and object field
valuesdoOptionalProcessing - - true if the validation should do optional validation, false otherwiseprocessAttributes - - if true process all attribute definitions, skip if falseAttributeValidationExceptionpublic DataDictionaryService getDataDictionaryService()
DataDictionaryServicepublic void setDataDictionaryService(DataDictionaryService dataDictionaryService)
DataDictionaryServicedataDictionaryService - The dataDictionaryService to setpublic List<CollectionConstraintProcessor> getCollectionConstraintProcessors()
CollectionConstraintProcessor
Collection constraint processors are classes that determine if a feature of a collection of objects satisfies some constraint
public void setCollectionConstraintProcessors(List<CollectionConstraintProcessor> collectionConstraintProcessors)
CollectionConstraintProcessorcollectionConstraintProcessors - the collectionConstraintProcessors to setpublic List<ConstraintProvider> getConstraintProviders()
ConstraintProviders
Constraint providers are classes that map specific constraint types to a constraint resolver, which takes a constrainable definition
public void setConstraintProviders(List<ConstraintProvider> constraintProviders)
ConstraintProviderconstraintProviders - the constraintProviders to setpublic List<ConstraintProcessor> getElementConstraintProcessors()
ConstraintProcessor
Element constraint processors are classes that determine if a passed value is valid for a specific constraint at the individual object or object attribute level
public void setElementConstraintProcessors(List<ConstraintProcessor> elementConstraintProcessors)
ConstraintProcessorelementConstraintProcessors - the elementConstraintProcessors to setpublic DocumentDictionaryService getDocumentDictionaryService()
If the instance in this class has not be set, retrieve it using
KRADServiceLocatorWeb.getDocumentDictionaryService() and save locally
DocumentDictionaryServicepublic void setDocumentDictionaryService(DocumentDictionaryService documentDictionaryService)
DocumentDictionaryServicedocumentDictionaryService - - the DocumentDictionaryService to set@Deprecated public LegacyDataAdapter getLegacyDataAdapter()
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.