org.apache.cocoon.forms.datatype.validationruleimpl
Class AbstractValidationRuleBuilder

java.lang.Object
  extended by org.apache.cocoon.forms.datatype.validationruleimpl.AbstractValidationRuleBuilder
All Implemented Interfaces:
Disposable, Serviceable, ValidationRuleBuilder
Direct Known Subclasses:
AssertValidationRuleBuilder, EmailValidationRuleBuilder, LengthValidationRuleBuilder, Mod10ValidationRuleBuilder, RangeValidationRuleBuilder, RegExpValidationRuleBuilder, ValueCountValidationRuleBuilder

public abstract class AbstractValidationRuleBuilder
extends Object
implements ValidationRuleBuilder, Serviceable, Disposable

Abstract base class for ValidationRuleBuilder implementations.

Version:
$Id: AbstractValidationRuleBuilder.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
protected  ExpressionManager expressionManager
           
protected  ServiceManager serviceManager
           
 
Constructor Summary
AbstractValidationRuleBuilder()
           
 
Method Summary
protected  void buildFailMessage(Element validationRuleElement, AbstractValidationRule rule)
          Checks if the validation rule configuration contains a custom failmessage, and if so, sets it one the ValidationRule.
 void dispose()
           
protected  org.outerj.expression.Expression parseExpression(String exprString, Element element, String attrName)
          Parses an expression and throws a nice error message if this fails.
 void service(ServiceManager serviceManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.forms.datatype.ValidationRuleBuilder
build
 

Field Detail

expressionManager

protected ExpressionManager expressionManager

serviceManager

protected ServiceManager serviceManager
Constructor Detail

AbstractValidationRuleBuilder

public AbstractValidationRuleBuilder()
Method Detail

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

buildFailMessage

protected void buildFailMessage(Element validationRuleElement,
                                AbstractValidationRule rule)
Checks if the validation rule configuration contains a custom failmessage, and if so, sets it one the ValidationRule.


parseExpression

protected org.outerj.expression.Expression parseExpression(String exprString,
                                                           Element element,
                                                           String attrName)
                                                    throws Exception
Parses an expression and throws a nice error message if this fails.

Throws:
Exception

dispose

public void dispose()
Specified by:
dispose in interface Disposable


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.