org.javalid.core.extvalidator
Interface SpringValidatorExt

All Known Implementing Classes:
SpringValidatorExtImpl

public interface SpringValidatorExt

Interface that should be implemented by a validator that uses spring beans to perform validation. Default validator is SpringValidatorImpl found in the spring-dep project. You are free to provide a custom implementation if the default is not sufficient (specify through jv-config.xml in that case)

Since:
1.0
Version:
1.0
Author:
M.Reuvers

Method Summary
 void setJvConfigurationWrapper(JvConfigurationWrapper jvConfigWrapper)
          Called by the jv framework when initializing a SpringValidator implementation (right after constructing an instance).
 void setSpringLookup(SpringLookupExt springLookupExt)
          This method is called by the JV framework (after setJvConfiguration) is called) and sets the lookup interface to use
 java.util.List<ValidationMessage> validate(java.lang.Object currentInstance, java.lang.String prefixPath, java.lang.String beanName, JvMethod jvMethod)
          This method is called by the JV framework (SpringAnnotationValidatorImpl) if an object to validate has defined a spring lookup and thus must be validated through a spring bean.
 

Method Detail

validate

java.util.List<ValidationMessage> validate(java.lang.Object currentInstance,
                                           java.lang.String prefixPath,
                                           java.lang.String beanName,
                                           JvMethod jvMethod)
This method is called by the JV framework (SpringAnnotationValidatorImpl) if an object to validate has defined a spring lookup and thus must be validated through a spring bean. It is the developer's responsibility to provide JvMethod with parameters that are needed. Think of: Object value and String prefixPath. These can be specified in a JvParam (see docs)

Parameters:
currentInstance - The current instance for validation
prefixPath - The prefix path for this instance
beanName - The name of the spring bean to use
jvMethod - The method containing the actual call to be performed on the bean with ALL needed parameters.
Returns:
List containing ValidationMesssage instances if errors were encountered, if no errors an empty list must be returned.

setJvConfigurationWrapper

void setJvConfigurationWrapper(JvConfigurationWrapper jvConfigWrapper)
Called by the jv framework when initializing a SpringValidator implementation (right after constructing an instance). The default implementation uses the configuration to find out how to lookup beans etc.

Parameters:
jvConfigWrapper - The configuration of the framework, allowing you access to the current configuration.

setSpringLookup

void setSpringLookup(SpringLookupExt springLookupExt)
This method is called by the JV framework (after setJvConfiguration) is called) and sets the lookup interface to use

Parameters:
springLookupExt - The lookup interface to use