org.springjutsu.validation.rules
Class ValidationRulesContainer

java.lang.Object
  extended by org.springjutsu.validation.rules.ValidationRulesContainer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware

public class ValidationRulesContainer
extends Object
implements org.springframework.beans.factory.BeanFactoryAware

This serves as a container for all parsed validation rules. The container serves the rules when requested to the

Author:
Clark Duplichien, Taylor Wicksell

Constructor Summary
ValidationRulesContainer()
           
 
Method Summary
 List<Class<?>> getExcludeAnnotations()
           
 List<ValidationRule> getRules(Class<?> clazz, String form)
          Retrieves rules stored for a given class.
 ValidationEntity getValidationEntity(Class<?> clazz)
           
 Boolean hasRulesForClass(Class<?> clazz)
           
protected  void initRuleInheritance()
          Copy rules from parent classes into child classes.
protected  void initValidationEntityMap()
          Inititalizes the validation entity map by scanning for
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setExcludeAnnotations(List<Class<?>> excludeAnnotations)
           
 Boolean supportsClass(Class<?> clazz)
           
protected  void unwrapTemplateReference(ValidationTemplateReference templateReference, List<ValidationRule> dumpTo, Stack<String> usedNames, String baseName, Map<String,ValidationTemplate> validationTemplateMap)
           
protected  void unwrapTemplateReferences()
          Since use of template references and performing error checking on them would otherwise be expensive, unwrap all template references into rule sets during initialization.
protected  void unwrapValidationRuleTemplateReferences(ValidationRule rule, Stack<String> usedNames, String baseName, Map<String,ValidationTemplate> validationTemplateMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationRulesContainer

public ValidationRulesContainer()
Method Detail

getValidationEntity

public ValidationEntity getValidationEntity(Class<?> clazz)

initValidationEntityMap

protected void initValidationEntityMap()
Inititalizes the validation entity map by scanning for


initRuleInheritance

protected void initRuleInheritance()
Copy rules from parent classes into child classes.


unwrapTemplateReferences

protected void unwrapTemplateReferences()
Since use of template references and performing error checking on them would otherwise be expensive, unwrap all template references into rule sets during initialization.


unwrapTemplateReference

protected void unwrapTemplateReference(ValidationTemplateReference templateReference,
                                       List<ValidationRule> dumpTo,
                                       Stack<String> usedNames,
                                       String baseName,
                                       Map<String,ValidationTemplate> validationTemplateMap)

unwrapValidationRuleTemplateReferences

protected void unwrapValidationRuleTemplateReferences(ValidationRule rule,
                                                      Stack<String> usedNames,
                                                      String baseName,
                                                      Map<String,ValidationTemplate> validationTemplateMap)

getRules

public List<ValidationRule> getRules(Class<?> clazz,
                                     String form)
Retrieves rules stored for a given class.

Parameters:
clazz - The class to retrieve rules for.
form - A string describing the form which the context rules are to apply to.
Returns:
the list of validation rules applying to the form and class.

hasRulesForClass

public Boolean hasRulesForClass(Class<?> clazz)
Parameters:
clazz - The class to check rules for
Returns:
true if there exist model rules for the class.

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Parameters:
beanFactory - the beanFactory to set

supportsClass

public Boolean supportsClass(Class<?> clazz)
Parameters:
clazz - the class to determine support for.
Returns:
true if an XML validation entity was created for the specified class. Used during recursive model rule validation to determine which fields require nested model validation.

getExcludeAnnotations

public List<Class<?>> getExcludeAnnotations()

setExcludeAnnotations

public void setExcludeAnnotations(List<Class<?>> excludeAnnotations)


Copyright © 2013 Spring Jutsu. All Rights Reserved.