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:
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(java.lang.String expression)
           
ValangCondition(java.lang.String expression, java.util.Map functionsByName, java.util.Map parserByRegexp)
           
 
Method Summary
 void addCustomFunction(java.lang.String functionName, java.lang.String functionClassName)
          Adds the a new custom function to be used in the valang el.
 boolean doCheck(java.lang.Object object)
          Performs the actual checking of this condition on the checked object.
 void setApplicationContext(ApplicationContext applicationContext)
           
 void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 void setCustomFunctions(java.util.Map functionByName)
          Sets custom functions that should be registered with the used ValangParser.
 void setDateParsers(java.util.Map parserByRegexp)
          Sets the date parser that should be registered with the used ValangParser.
 void setMessageSource(MessageSource messageSource)
           
 void setResourceLoader(ResourceLoader resourceLoader)
           
 void setServletContext(ServletContext servletContext)
           
 
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(java.lang.String expression)

ValangCondition

public ValangCondition(java.lang.String expression,
                       java.util.Map functionsByName,
                       java.util.Map parserByRegexp)
Method Detail

doCheck

public boolean doCheck(java.lang.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(java.lang.String functionName,
                              java.lang.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(java.util.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(java.util.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.

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Throws:
BeansException

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Throws:
BeansException

setResourceLoader

public void setResourceLoader(ResourceLoader resourceLoader)

setMessageSource

public void setMessageSource(MessageSource messageSource)

setServletContext

public void setServletContext(ServletContext servletContext)

setApplicationEventPublisher

public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)


Copyright © 2005. All Rights Reserved.