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

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.validator.ValidationController

public class ValidationController
extends Object

A combination view controller for the Rice Dictionary Validator that handles both the setup/execution of the validation and the output of the results.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected  boolean displayErrorMessages
           
protected  boolean displayErrors
           
protected  boolean displayWarningMessages
           
protected  boolean displayWarnings
           
protected  boolean displayXmlPages
           
protected static String endl
           
 
Constructor Summary
ValidationController()
          Constructor creating a new Rice Dictionary Validator
ValidationController(boolean displayErrors, boolean displayWarnings, boolean displayErrorMessages, boolean displayWarningMessages, boolean displayXmlPages)
          Constructor creating a new Rice Dictionary Validator with limited information during output
 
Method Summary
 boolean isDisplayErrorMessages()
          Gets the displayErrorMessages, whether the error messages should be displayed
 boolean isDisplayErrors()
          Gets the displayErrors, whether the number of errors should be displayed
 boolean isDisplayWarningMessages()
          Gets the displayWarningMessages, whether the warning messages should be displayed
 boolean isDisplayWarnings()
          Gets the displayWarnings, whether the number of warnings should be displayed
 boolean isDisplayXmlPages()
          Gets the displayXmlPages, whether the xml pages involved should be displayed
 void setDisplayErrorMessages(boolean display)
          Sets the displayErrorMessages
 void setDisplayErrors(boolean display)
          Sets the displayErrors
 void setDisplayWarningMessages(boolean display)
          Sets the displayWarningMessages
 void setDisplayWarnings(boolean display)
          Sets the displayWarnings
 void setDisplayXmlPages(boolean display)
          Sets the displayXmlPages
 boolean validate(Component object, org.apache.commons.logging.Log log, boolean failOnWarning)
          Validates a Component with output going to Log4j
 boolean validate(String[] xmlFiles, boolean failOnWarning)
          Validates a collection of Spring Beans with no output
 boolean validate(String[] xmlFiles, org.apache.commons.logging.Log log, boolean failOnWarning)
          Validates a collection of Spring Beans with output going to Log4j
 boolean validate(String[] xmlFiles, PrintStream stream, boolean failOnWarning)
          Validates a collection of Spring Beans with output going to a print stream
 boolean validate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, KualiDefaultListableBeanFactory beans, boolean failOnWarning)
          Validates a collection of Spring Beans with no output
 boolean validate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, KualiDefaultListableBeanFactory beans, org.apache.commons.logging.Log log, boolean failOnWarning)
          Validates a collection of Spring Beans with output going to Log4j
 boolean validate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, KualiDefaultListableBeanFactory beans, PrintStream stream, boolean failOnWarning)
          Validates a collection of Spring Beans with output going to a print stream
 boolean validate(String[] xmlFiles, org.springframework.core.io.ResourceLoader loader, KualiDefaultListableBeanFactory beans, String outputFile, boolean failOnWarning)
          Validates a collection of Spring Beans with output going to a file
 boolean validate(String[] xmlFiles, String outputFile, boolean failOnWarning)
          Validates a collection of Spring Beans with output going to a file
protected  void writeToFile(String path, Validator validator, boolean passed)
          Writes the results of the validation to an output file
protected  void writeToLog(org.apache.commons.logging.Log log, Validator validator, boolean passed)
          Writes the results of the validation to an output file
protected  void writeToStream(PrintStream stream, Validator validator, boolean passed)
          Writes the results of the validation to an output file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endl

protected static final String endl

displayWarnings

protected boolean displayWarnings

displayErrors

protected boolean displayErrors

displayXmlPages

protected boolean displayXmlPages

displayErrorMessages

protected boolean displayErrorMessages

displayWarningMessages

protected boolean displayWarningMessages
Constructor Detail

ValidationController

public ValidationController(boolean displayErrors,
                            boolean displayWarnings,
                            boolean displayErrorMessages,
                            boolean displayWarningMessages,
                            boolean displayXmlPages)
Constructor creating a new Rice Dictionary Validator with limited information during output

Parameters:
displayErrors - - True if the Validator should show the number of error during output
displayWarnings - - True if the Validator should show the number of warnings during output
displayErrorMessages - - True if the Validator should show the messages for the error reports
displayWarningMessages - - True if the Validator should show messages involving warnings
displayXmlPages - - True if the Validator should show the list of xml pages for the error reports

ValidationController

public ValidationController()
Constructor creating a new Rice Dictionary Validator

Method Detail

validate

public boolean validate(String[] xmlFiles,
                        org.springframework.core.io.ResourceLoader loader,
                        KualiDefaultListableBeanFactory beans,
                        boolean failOnWarning)
Validates a collection of Spring Beans with no output

Parameters:
xmlFiles - - The collection of xml files used to load the provided 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

validate

public boolean validate(String[] xmlFiles,
                        org.springframework.core.io.ResourceLoader loader,
                        KualiDefaultListableBeanFactory beans,
                        String outputFile,
                        boolean failOnWarning)
Validates a collection of Spring Beans with output going to a file

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
outputFile - - The file location to save the output to
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,
                        PrintStream stream,
                        boolean failOnWarning)
Validates a collection of Spring Beans with output going to a print stream

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
stream - - The PrintStream the output is sent to
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,
                        org.apache.commons.logging.Log log,
                        boolean failOnWarning)
Validates a collection of Spring Beans with output going to Log4j

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
log - - The Log4j logger the output is sent to
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,
                        boolean failOnWarning)
Validates a collection of Spring Beans with no output

Parameters:
xmlFiles - - The collection of xml files used to load the beans
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,
                        String outputFile,
                        boolean failOnWarning)
Validates a collection of Spring Beans with output going to a file

Parameters:
xmlFiles - - The collection of xml files used to load the beans
outputFile - - The file location to save the output to
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,
                        PrintStream stream,
                        boolean failOnWarning)
Validates a collection of Spring Beans with output going to a print stream

Parameters:
xmlFiles - - The collection of xml files used to load the beans
stream - - The PrintStream the output is sent to
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.apache.commons.logging.Log log,
                        boolean failOnWarning)
Validates a collection of Spring Beans with output going to Log4j

Parameters:
xmlFiles - - The collection of xml files used to load the provided beans
log - - The Log4j logger the output is sent to
failOnWarning - - Whether detecting a warning should cause the validation to fail
Returns:
Returns true if the beans past validation

validate

public boolean validate(Component object,
                        org.apache.commons.logging.Log log,
                        boolean failOnWarning)
Validates a Component with output going to Log4j

Parameters:
object - - The component to be validated
log - - The Log4j logger the output is sent to
failOnWarning - - Whether detecting a warning should cause the validation to fail
Returns:
Returns true if the beans past validation

writeToFile

protected void writeToFile(String path,
                           Validator validator,
                           boolean passed)
Writes the results of the validation to an output file

Parameters:
path - - The path to the file to write results to
validator - - The filled validator
passed - - Whether the validation passed or not

writeToStream

protected void writeToStream(PrintStream stream,
                             Validator validator,
                             boolean passed)
Writes the results of the validation to an output file

Parameters:
stream - - The PrintStream the output is sent to
validator - - The filled validator
passed - - Whether the validation passed or not

writeToLog

protected void writeToLog(org.apache.commons.logging.Log log,
                          Validator validator,
                          boolean passed)
Writes the results of the validation to an output file

Parameters:
log - - The Log4j logger the output is sent to
validator - - The filled validator
passed - - Whether the validation passed or not

setDisplayWarnings

public void setDisplayWarnings(boolean display)
Sets the displayWarnings

Parameters:
display - - Display or not

setDisplayErrors

public void setDisplayErrors(boolean display)
Sets the displayErrors

Parameters:
display - - Display or not

setDisplayXmlPages

public void setDisplayXmlPages(boolean display)
Sets the displayXmlPages

Parameters:
display - - Display or not

setDisplayErrorMessages

public void setDisplayErrorMessages(boolean display)
Sets the displayErrorMessages

Parameters:
display - - Display or not

setDisplayWarningMessages

public void setDisplayWarningMessages(boolean display)
Sets the displayWarningMessages

Parameters:
display - - Display or not

isDisplayWarnings

public boolean isDisplayWarnings()
Gets the displayWarnings, whether the number of warnings should be displayed

Returns:
displayWarnings

isDisplayErrors

public boolean isDisplayErrors()
Gets the displayErrors, whether the number of errors should be displayed

Returns:
displayErros

isDisplayXmlPages

public boolean isDisplayXmlPages()
Gets the displayXmlPages, whether the xml pages involved should be displayed

Returns:
displayXmlPages

isDisplayErrorMessages

public boolean isDisplayErrorMessages()
Gets the displayErrorMessages, whether the error messages should be displayed

Returns:
displayErrorMessages

isDisplayWarningMessages

public boolean isDisplayWarningMessages()
Gets the displayWarningMessages, whether the warning messages should be displayed

Returns:
displayWarningMessages


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