Class Validator
java.lang.Object
org.kuali.rice.krad.datadictionary.validator.Validator
A validator for Rice Dictionaries that stores the information found during its validation.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddErrorReport(ErrorReport report) static booleancheckExpressions(Component object, String property) Checks if a property of a Component is being set by expressionsgetErrorReport(int index) Retrieves an individual error report for errors found during the validationstatic List<ErrorReport> intRetrieves the number of error reports generated during the validationintRetrieves the number of errors found in the validationintRetrieves the number of warnings found in the validationorg.springframework.beans.factory.support.DefaultListableBeanFactoryLoads the Spring Beans from a list of xml filesstatic voidbooleanValidates the beans in a collection of xml filesbooleanvalidate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, org.springframework.beans.factory.support.DefaultListableBeanFactory beans, boolean failOnWarning) Validates a collection of beansbooleanValidates a UIF Componentstatic booleanvalidateSpringEL(String expression) Validates an expression string for correct Spring Expression language syntax
-
Constructor Details
-
Validator
public Validator()Constructor creating an empty validation report
-
-
Method Details
-
addErrorReport
-
resetErrorReport
public static void resetErrorReport() -
validate
Validates a UIF Component- Parameters:
object- - The UIF Component to be validatedfailOnWarning- - Whether the validation should fail if warnings are found- Returns:
- Returns true if the validation passes
-
validate
Validates the beans in a collection of xml files- Parameters:
xmlFiles- files to validatefailOnWarning- - Whether detecting a warning should cause the validation to fail- Returns:
- Returns true if the beans past validation
-
validate
public boolean validate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, org.springframework.beans.factory.support.DefaultListableBeanFactory beans, boolean failOnWarning) Validates a collection of beans- Parameters:
xmlFiles- - The collection of xml files used to load the provided beansloader- - The source that was used to load the beansbeans- - Collection of preloaded beansfailOnWarning- - Whether detecting a warning should cause the validation to fail- Returns:
- Returns true if the beans past validation
-
validateSpringEL
Validates an expression string for correct Spring Expression language syntax- Parameters:
expression- - The expression being validated- Returns:
- Returns true if the expression is of correct SpringEL syntax
-
checkExpressions
Checks if a property of a Component is being set by expressions- Parameters:
object- - The Component being checkedproperty- - The property being set- Returns:
- Returns true if the property is contained in the Components property expressions
-
loadBeans
public org.springframework.beans.factory.support.DefaultListableBeanFactory loadBeans(String[] xmlFiles) Loads the Spring Beans from a list of xml files- Parameters:
xmlFiles-- Returns:
- The Spring Bean Factory for the provided list of xml files
-
getNumberOfErrors
public int getNumberOfErrors()Retrieves the number of errors found in the validation- Returns:
- The number of errors found in the validation
-
getNumberOfWarnings
public int getNumberOfWarnings()Retrieves the number of warnings found in the validation- Returns:
- The number of warnings found in the validation
-
getErrorReport
Retrieves an individual error report for errors found during the validation- Parameters:
index-- Returns:
- The error report at the provided index
-
getErrorReportSize
public int getErrorReportSize()Retrieves the number of error reports generated during the validation- Returns:
- The number of ErrorReports
-
getErrorReports
-