org.javalid.core.extension
Interface JavalidExtensionLookup

All Superinterfaces:
JavalidExtension
All Known Implementing Classes:
JavalidExtensionJsfImpl, JavalidExtensionSpringImpl

public interface JavalidExtensionLookup
extends JavalidExtension

This extension interface is required by extensions that support some kind of lookup and/or validation. Generally its only used by extensions that ship with JaValid. Likely you don't need this interface at all but its parent instead.

Since:
1.1
Version:
1.0
Author:
M.Reuvers

Method Summary
 java.lang.Object lookupBean(java.lang.String name)
          Based on given name attempts to lookup a bean.
 java.util.List<ValidationMessage> validate(java.lang.Object currentInstance, java.lang.String prefixPath, java.lang.String beanNameExpression, JvMethod jvMethod)
          This method is called by the JV framework if an object to validate has defined a lookup and thus must be validated through a bean.
 
Methods inherited from interface org.javalid.core.extension.JavalidExtension
afterValidation, beforeValidation, configurationLoadingComplete, destroy, init
 

Method Detail

lookupBean

java.lang.Object lookupBean(java.lang.String name)
Based on given name attempts to lookup a bean. Implementors must raise a JavalidLookupFailedException if the bean was NOT found. If the bean was found, but null, simply return null.

Parameters:
name - The name to lookup
Returns:
The Object found (even if its null), if not found raise JavalidLookupException

validate

java.util.List<ValidationMessage> validate(java.lang.Object currentInstance,
                                           java.lang.String prefixPath,
                                           java.lang.String beanNameExpression,
                                           JvMethod jvMethod)
This method is called by the JV framework if an object to validate has defined a lookup and thus must be validated through a 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
beanNameExpression - 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.