org.javalid.external.spring
Class SpringAnnotationValidatorImpl

java.lang.Object
  extended by org.javalid.core.AnnotationValidatorImpl
      extended by org.javalid.external.spring.SpringAnnotationValidatorImpl
All Implemented Interfaces:
AnnotationValidator, org.springframework.context.ApplicationContextAware

public class SpringAnnotationValidatorImpl
extends AnnotationValidatorImpl
implements org.springframework.context.ApplicationContextAware

This validator extends AnnotationValidatorImpl and is 'Spring-aware' by implementing ApplicationContextAware. This validator should be used if you need Spring support (thus need the spring-dependency jar file) and have ENABLED the spring extension in the configuration file.

Since:
1.0
Version:
1.0
Author:
M.Reuvers

Field Summary
protected  org.springframework.context.ApplicationContext context
           
 
Fields inherited from class org.javalid.core.AnnotationValidatorImpl
annotationSupport, cacheSupport, debugSupport, jvConfig, jvConfigWrapper
 
Constructor Summary
SpringAnnotationValidatorImpl(java.lang.String xmlConfigFile)
          Use given xml config file to configure JV, this file is required as the default config that ships with JV does not have spring enabled.
SpringAnnotationValidatorImpl(java.lang.String xmlConfigFile, boolean setValueToNullIfEmptyString)
          Use given xml config file to configure JV, this file is required as the default config that ships with JV does not have spring enabled.
 
Method Summary
 void setApplicationContext(org.springframework.context.ApplicationContext context)
           
 
Methods inherited from class org.javalid.core.AnnotationValidatorImpl
validateObject, validateObject, validateObject, validateObject, validateObject, validateObject, validateObject, validateObject, validateObject, validateObject, validateObject, validateObjectPriv, validateProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected org.springframework.context.ApplicationContext context
Constructor Detail

SpringAnnotationValidatorImpl

public SpringAnnotationValidatorImpl(java.lang.String xmlConfigFile)
Use given xml config file to configure JV, this file is required as the default config that ships with JV does not have spring enabled.

Parameters:
xmlConfigFile - The xml configuration file

SpringAnnotationValidatorImpl

public SpringAnnotationValidatorImpl(java.lang.String xmlConfigFile,
                                     boolean setValueToNullIfEmptyString)
Use given xml config file to configure JV, this file is required as the default config that ships with JV does not have spring enabled.

Parameters:
xmlConfigFile - The xml configuration file
setValueToNullIfEmptyString - Defaults to false, but if set to true when a String/StringBuffer value to validate is encountered and they are EMPTY, they are set to null instead of leaving it like "".
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext context)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware