public class DefaultOValValidationManager extends Object implements OValValidationManager
Modifier and Type | Field and Description |
---|---|
protected boolean |
validateJPAAnnotations |
protected static String |
VALIDATION_CONFIG_SUFFIX |
protected Map<String,List<net.sf.oval.configuration.Configurer>> |
validatorCache |
protected Map<String,net.sf.oval.configuration.Configurer> |
validatorFileCache |
Constructor and Description |
---|
DefaultOValValidationManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addIfNotNull(List<net.sf.oval.configuration.Configurer> configurers,
net.sf.oval.configuration.Configurer configurer) |
protected net.sf.oval.configuration.xml.XMLConfigurer |
buildAliasValidatorConfigs(Class aClass,
String context,
boolean checkFile) |
protected net.sf.oval.configuration.xml.XMLConfigurer |
buildClassValidatorConfigs(Class aClass,
boolean checkFile) |
protected static String |
buildValidatorKey(Class clazz,
String context) |
List<net.sf.oval.configuration.Configurer> |
getConfigurers(Class clazz,
String context,
boolean validateJPAAnnotations)
This method 'collects' all the validator configurations for a given
action invocation.
|
protected net.sf.oval.configuration.xml.XMLConfigurer |
loadFile(String fileName,
Class clazz,
boolean checkFile) |
void |
setFileManagerFactory(FileManagerFactory fileManagerFactory) |
void |
setReloadingConfigs(String reloadingConfigs) |
protected static final String VALIDATION_CONFIG_SUFFIX
protected final Map<String,List<net.sf.oval.configuration.Configurer>> validatorCache
protected final Map<String,net.sf.oval.configuration.Configurer> validatorFileCache
protected boolean validateJPAAnnotations
public void setReloadingConfigs(String reloadingConfigs)
public void setFileManagerFactory(FileManagerFactory fileManagerFactory)
public List<net.sf.oval.configuration.Configurer> getConfigurers(Class clazz, String context, boolean validateJPAAnnotations)
OValValidationManager
This method 'collects' all the validator configurations for a given action invocation.
It will traverse up the class hierarchy looking for validators for every super class and directly implemented interface of the current action, as well as adding validators for any alias of this invocation. Nifty!
Given the following class structure:
interface Thing; interface Animal extends Thing; interface Quadraped extends Animal; class AnimalImpl implements Animal; class QuadrapedImpl extends AnimalImpl implements Quadraped; class Dog extends QuadrapedImpl;
This method will look for the following config files for Dog:
Animal Animal-context AnimalImpl AnimalImpl-context Quadraped Quadraped-context QuadrapedImpl QuadrapedImpl-context Dog Dog-context
Note that the validation rules for Thing is never looked for because no class in the hierarchy directly implements Thing.
getConfigurers
in interface OValValidationManager
clazz
- the Class to look up validators for.context
- the context to use when looking up validators.
updated.protected void addIfNotNull(List<net.sf.oval.configuration.Configurer> configurers, net.sf.oval.configuration.Configurer configurer)
protected net.sf.oval.configuration.xml.XMLConfigurer buildAliasValidatorConfigs(Class aClass, String context, boolean checkFile)
protected net.sf.oval.configuration.xml.XMLConfigurer buildClassValidatorConfigs(Class aClass, boolean checkFile)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.