com.primix.tapestry.valid
Class ValidationDelegate

java.lang.Object
  |
  +--com.primix.tapestry.valid.BaseValidationDelegate
        |
        +--com.primix.tapestry.valid.ValidationDelegate
All Implemented Interfaces:
IPoolable, IValidationDelegate

public class ValidationDelegate
extends BaseValidationDelegate
implements IPoolable

A simple implementation of IValidationDelegate that can be used as a helper bean.

Since:
1.0.5
Version:
$Id: ValidationDelegate.java,v 1.1 2001/08/28 20:33:42 hship Exp $
Author:
Howard Ship

Constructor Summary
ValidationDelegate()
           
 
Method Summary
 java.lang.String getError()
          Returns the first error message, or null if there are no error messages.
 java.util.List getErrors()
          Returns a List of String, the errors collected during this request cycle.
 void invalidField(IValidatingTextField field, ValidationConstraint constraint, java.lang.String defaultErrorMessage)
          Does nothing! Subclasses will almost always want to override this to capture the defaultErrorMessage and store it where it can be displayed when the page is rendered.
 void resetForPool()
          Invoked by a Pool just before the object is added to the pool.
 
Methods inherited from class com.primix.tapestry.valid.BaseValidationDelegate
writeAttributes, writeErrorPrefix, writeErrorSuffix, writeLabelPrefix, writeLabelSuffix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationDelegate

public ValidationDelegate()
Method Detail

invalidField

public void invalidField(IValidatingTextField field,
                         ValidationConstraint constraint,
                         java.lang.String defaultErrorMessage)
Description copied from class: BaseValidationDelegate
Does nothing! Subclasses will almost always want to override this to capture the defaultErrorMessage and store it where it can be displayed when the page is rendered.
Overrides:
invalidField in class BaseValidationDelegate
Following copied from interface: com.primix.tapestry.valid.IValidationDelegate
Parameters:
field - the field to which the update applies to.
constraint - the ValidationConstraint which was violated.
defaultErrorMessage - a default, localized, error message.

resetForPool

public void resetForPool()
Description copied from interface: IPoolable
Invoked by a Pool just before the object is added to the pool. The object should return its state to how it was when freshly instantiated (or at least, its state should be indistinguishable from a freshly instantiated instance).
Specified by:
resetForPool in interface IPoolable

getError

public java.lang.String getError()
Returns the first error message, or null if there are no error messages.

getErrors

public java.util.List getErrors()
Returns a List of String, the errors collected during this request cycle. May return null, or an empty list, if there are no errors.