java.lang.Object
org.kuali.rice.krad.datadictionary.validator.Validator

public class Validator extends Object
A validator for Rice Dictionaries that stores the information found during its validation.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • Validator

      public Validator()
      Constructor creating an empty validation report
  • Method Details

    • addErrorReport

      public static void addErrorReport(ErrorReport report)
    • resetErrorReport

      public static void resetErrorReport()
    • validate

      public boolean validate(Component object, boolean failOnWarning)
      Validates a UIF Component
      Parameters:
      object - - The UIF Component to be validated
      failOnWarning - - Whether the validation should fail if warnings are found
      Returns:
      Returns true if the validation passes
    • validate

      public boolean validate(String[] xmlFiles, boolean failOnWarning)
      Validates the beans in a collection of xml files
      Parameters:
      xmlFiles - files to validate
      failOnWarning - - 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 beans
      loader - - The source that was used to load the beans
      beans - - Collection of preloaded beans
      failOnWarning - - Whether detecting a warning should cause the validation to fail
      Returns:
      Returns true if the beans past validation
    • validateSpringEL

      public static boolean validateSpringEL(String expression)
      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

      public static boolean checkExpressions(Component object, String property)
      Checks if a property of a Component is being set by expressions
      Parameters:
      object - - The Component being checked
      property - - 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

      public ErrorReport getErrorReport(int index)
      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

      public static List<ErrorReport> getErrorReports()