org.javalid.core.extension
Interface JavalidExtension

All Known Subinterfaces:
JavalidExtensionLookup
All Known Implementing Classes:
JavalidExtensionDatabaseImpl, JavalidExtensionJsfImpl, JavalidExtensionSpringImpl

public interface JavalidExtension

Any extension must implement this interface. It's not necessary to implement all methods, it all depends on the needs of the extension. Please read the method's documentation how it is used.

Since:
1.1
Version:
1.0
Author:
M.Reuvers

Method Summary
 void afterValidation(JvConfigurationWrapper wrapper)
          Once validation is done, this method is called and allows an extension to perform cleanup (if necessary).
 void beforeValidation(JvConfigurationWrapper wrapper)
          Before a the validation starts this methid is called, it can do some initialization or other things that might be needed.
 void configurationLoadingComplete(JvConfigurationWrapper wrapper)
          This method is called by the configuration loader as soon as it is done loading everything needed.
 void destroy()
          Called once the the AnnotationValidator's destroy() method has been called.
 void init(java.util.Map<java.lang.String,java.lang.String> parameters, JvConfigurationWrapper wrapper)
          This method is called only once, as soon as the extension is created (after its constructor has been called) and provides you with the parameters you might have passed to this extension.
 

Method Detail

init

void init(java.util.Map<java.lang.String,java.lang.String> parameters,
          JvConfigurationWrapper wrapper)
This method is called only once, as soon as the extension is created (after its constructor has been called) and provides you with the parameters you might have passed to this extension. The wrapper passed along may be used for some Javalid specific data you might need. Keep in mind however that extensions are initialized in the order you specify them in your configuration so not all data might be available so if you need another extension to be fully loaded (e.g. require spring beans from its context) you'd better use the method configurationLoadingComplete() method instead.

Parameters:
parameters - Map with parameters passed to this extension (keys are the name).
wrapper - The config wrapper

configurationLoadingComplete

void configurationLoadingComplete(JvConfigurationWrapper wrapper)
This method is called by the configuration loader as soon as it is done loading everything needed. If you require specific data from other extensions etc. this method is the one you'd want. Keep in mind that this method is called in the order of the extensions specified in the configuration file.

If you need parameters from the config file, save them in the init() method, which is called on creation of this extension.

Parameters:
wrapper - The config wrapper

beforeValidation

void beforeValidation(JvConfigurationWrapper wrapper)
Before a the validation starts this methid is called, it can do some initialization or other things that might be needed.

Parameters:
wrapper - The config wrapper

afterValidation

void afterValidation(JvConfigurationWrapper wrapper)
Once validation is done, this method is called and allows an extension to perform cleanup (if necessary).

Parameters:
wrapper - The config wrapper

destroy

void destroy()
Called once the the AnnotationValidator's destroy() method has been called. This allows this extension to cleanup. Do not fully rely on it though.