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, 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 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.
 
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.


Copyright © 2009. All Rights Reserved.