org.springmodules.validation.util.cel.valang
Class ValangCondition

java.lang.Object
  extended by org.springmodules.validation.util.condition.AbstractCondition
      extended by org.springmodules.validation.util.cel.valang.ValangCondition
All Implemented Interfaces:
BeanFactoryAware, ApplicationContextAware, ApplicationEventPublisherAware, MessageSourceAware, ResourceLoaderAware, Condition, ContextAware, ValangBased

public class ValangCondition
extends AbstractCondition
implements ValangBased

A Condition implementation that checks the given object based on a valang boolean expression.

Author:
Uri Boness

Constructor Summary
ValangCondition(String expression)
          Constructor
ValangCondition(String expression, Map functionsByName, Map parserByRegexp)
          Constructor
 
Method Summary
 void addCustomFunction(String functionName, String functionClassName)
          Adds the a new custom function to be used in the valang el.
 boolean doCheck(Object object)
          Performs the actual checking of this condition on the checked object.
 void setApplicationContext(ApplicationContext applicationContext)
          Implementation of ApplicationContextAware.
 void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
          Implementation of ApplicationEventPublisherAware.
 void setBeanFactory(BeanFactory beanFactory)
          Implementation of BeanFactoryAware.
 void setCustomFunctions(Map functionByName)
          Sets custom functions that should be registered with the used ValangParser.
 void setDateParsers(Map parserByRegexp)
          Sets the date parser that should be registered with the used ValangParser.
 void setMessageSource(MessageSource messageSource)
          Implementation of MessageSourceAware.
 void setResourceLoader(ResourceLoader resourceLoader)
          Implementation of ResourceLoaderAware.
 
Methods inherited from class org.springmodules.validation.util.condition.AbstractCondition
afterObjectChecked, and, beforeObjectChecked, check, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValangCondition

public ValangCondition(String expression)
Constructor


ValangCondition

public ValangCondition(String expression,
                       Map functionsByName,
                       Map parserByRegexp)
Constructor

Method Detail

doCheck

public boolean doCheck(Object object)
Description copied from class: AbstractCondition
Performs the actual checking of this condition on the checked object.

Specified by:
doCheck in class AbstractCondition
Parameters:
object - The object to be checked.
Returns:
true if the given object adheres to this condition, false otherwise.

addCustomFunction

public void addCustomFunction(String functionName,
                              String functionClassName)
Description copied from interface: ValangBased
Adds the a new custom function to be used in the valang el.

Specified by:
addCustomFunction in interface ValangBased
Parameters:
functionName - The name of the function.
functionClassName - The fully qualified class name of the function.

setCustomFunctions

public void setCustomFunctions(Map functionByName)
Description copied from interface: ValangBased
Sets custom functions that should be registered with the used ValangParser.

Specified by:
setCustomFunctions in interface ValangBased
Parameters:
functionByName - the custom functions where the key is the function name and the value is the function class FQN.

setDateParsers

public void setDateParsers(Map parserByRegexp)
Description copied from interface: ValangBased
Sets the date parser that should be registered with the used ValangParser.

Specified by:
setDateParsers in interface ValangBased
Parameters:
parserByRegexp - the date parsers where the key is the regexp associated with the parser and the value is the parser class FQN.

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Implementation of BeanFactoryAware.

Specified by:
setBeanFactory in interface BeanFactoryAware
Throws:
BeansException

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Implementation of ApplicationContextAware.

Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)
Implementation of ResourceLoaderAware.

Specified by:
setResourceLoader in interface ResourceLoaderAware

setMessageSource

public void setMessageSource(MessageSource messageSource)
Implementation of MessageSourceAware.

Specified by:
setMessageSource in interface MessageSourceAware

setApplicationEventPublisher

public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
Implementation of ApplicationEventPublisherAware.

Specified by:
setApplicationEventPublisher in interface ApplicationEventPublisherAware


Copyright © 2009. All Rights Reserved.