org.javalid.core.validator
Class JvConfigurationWrapper

java.lang.Object
  extended by org.javalid.core.validator.JvConfigurationWrapper

public class JvConfigurationWrapper
extends java.lang.Object

Wrapper class that is exposed to validator's implementations. This is done on purpose for not exposing everything from the configuration. This way maintenance for backwards compatibility in the future is easier preserved.

Since:
1.0
Version:
1.0
Author:
M.Reuvers

Constructor Summary
JvConfigurationWrapper(JvConfiguration configuration, AnnotationValidator annotationValidator)
          Construct this wrapper
 
Method Summary
 AnnotationValidator getAnnotationValidator()
          Get the validator to use if needed (some advanced validation annotations need it)
 javax.el.ELContext getELContext()
          Returns the context that is used by the framework.
 javax.el.ExpressionFactory getExpressionFactory()
          Returns a new ExpressionFactory to use
 JavalidExtension getExtension(java.lang.String nameExtension)
          Returns the extension for given name if found, null otherwise.
 java.lang.String[] getProxyRecognizers()
          Returns all names to recognize a classname as a proxied object (only valid if isCheckForProxy() returns true, else this returns null).
 boolean isCheckAnnotationsOnMethods()
          Returns true if annotations must be checked on methods, if false fields must be used.
 boolean isCheckForProxy()
          Return true if classes should check the parent class for an annotation (method annotations e.g) if not found on the current method/class.
 boolean isExtensionLoaded(java.lang.String nameExtension)
          Returns true if an extension under given name is loaded, false otherwise.
 boolean isPluralAnnotationSupported(java.lang.String className)
          Returns true if given plural annotation is supported.
 java.lang.Object lookupBean(java.lang.String beanLookupName)
          Attemps to lookup given beanName and returns bean instance if found (could be null).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JvConfigurationWrapper

public JvConfigurationWrapper(JvConfiguration configuration,
                              AnnotationValidator annotationValidator)
Construct this wrapper

Parameters:
configuration - The configuration
annotationValidator - The validator in use (with given configuration)
Method Detail

lookupBean

public java.lang.Object lookupBean(java.lang.String beanLookupName)
Attemps to lookup given beanName and returns bean instance if found (could be null). If not found raises a JvLookupFailedException.

Parameters:
beanLookupName - The beanName to lookup
Returns:
Bean instance if found, JvException if not found.
Since:
1.1

getProxyRecognizers

public java.lang.String[] getProxyRecognizers()
Returns all names to recognize a classname as a proxied object (only valid if isCheckForProxy() returns true, else this returns null).

Returns:
Array with names to recognize proxies from (or null if checkForProxy = false).

isCheckForProxy

public boolean isCheckForProxy()
Return true if classes should check the parent class for an annotation (method annotations e.g) if not found on the current method/class.

Returns:
True if classes should check parent class for an annotation as well if not found on current class

getAnnotationValidator

public AnnotationValidator getAnnotationValidator()
Get the validator to use if needed (some advanced validation annotations need it)

Returns:
AnnotationValidator, that was used when creating this wrapper.

isCheckAnnotationsOnMethods

public boolean isCheckAnnotationsOnMethods()
Returns true if annotations must be checked on methods, if false fields must be used.

Returns:
True if annotations must be checked on methods, if false fields must be used.

getELContext

public javax.el.ELContext getELContext()
Returns the context that is used by the framework.

Returns:
Current context used by the framework
Since:
1.1
See Also:
JvConfiguration.getELContext()

getExpressionFactory

public javax.el.ExpressionFactory getExpressionFactory()
Returns a new ExpressionFactory to use

Returns:
ExpressionFactory to use.
Since:
1.1

isExtensionLoaded

public boolean isExtensionLoaded(java.lang.String nameExtension)
Returns true if an extension under given name is loaded, false otherwise.

Parameters:
nameExtension - The name of the extension
Returns:
Returns true if an extension under given name is loaded, false otherwise.
Since:
1.1

getExtension

public JavalidExtension getExtension(java.lang.String nameExtension)
Returns the extension for given name if found, null otherwise.

Parameters:
nameExtension - The name of the extension.
Returns:
The extension if found or null
Since:
1.1

isPluralAnnotationSupported

public boolean isPluralAnnotationSupported(java.lang.String className)
Returns true if given plural annotation is supported.

Parameters:
className - The annotation classname to check
Returns:
True if supported, false otherwise.
Since:
1.1