org.kuali.rice.krad.datadictionary.validator
Class Validator

java.lang.Object
  extended by 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 Summary
Validator()
          Constructor creating an empty validation report
 
Method Summary
static void addErrorReport(ErrorReport report)
           
static boolean checkExpressions(Component object, String property)
          Checks if a property of a Component is being set by expressions
 ErrorReport getErrorReport(int index)
          Retrieves an individual error report for errors found during the validation
 int getErrorReportSize()
          Retrieves the number of error reports generated during the validation
 int getNumberOfErrors()
          Retrieves the number of errors found in the validation
 int getNumberOfWarnings()
          Retrieves the number of warnings found in the validation
 KualiDefaultListableBeanFactory loadBeans(String[] xmlFiles)
          Loads the Spring Beans from a list of xml files
static void resetErrorReport()
           
 boolean validate(Component object, boolean failOnWarning)
          Validates a UIF Component
 boolean validate(String[] xmlFiles, boolean failOnWarning)
          Validates the beans in a collection of xml files
 boolean validate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, KualiDefaultListableBeanFactory beans, boolean failOnWarning)
          Validates a collection of beans
static boolean validateSpringEL(String expression)
          Validates an expression string for correct Spring Expression language syntax
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator()
Constructor creating an empty validation report

Method Detail

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:
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,
                        KualiDefaultListableBeanFactory 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 KualiDefaultListableBeanFactory 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


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.