org.apache.tapestry.form.validator
Class BaseValidator

java.lang.Object
  extended by org.apache.tapestry.form.validator.BaseValidator
All Implemented Interfaces:
FormComponentContributor, Validator
Direct Known Subclasses:
Email, Max, MaxDate, MaxLength, Min, MinDate, MinLength, Pattern, Required

public abstract class BaseValidator
extends java.lang.Object
implements Validator

Abstract implementation of Validator.

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
BaseValidator()
           
BaseValidator(java.lang.String initializer)
           
 
Method Summary
 boolean getAcceptsNull()
          Returns false.
 java.lang.String getMessage()
           
 boolean isRequired()
          Returns false.
 void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
          Does nothing.
 void setMessage(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.form.validator.Validator
validate
 

Constructor Detail

BaseValidator

public BaseValidator()

BaseValidator

public BaseValidator(java.lang.String initializer)
Method Detail

getMessage

public java.lang.String getMessage()

setMessage

public void setMessage(java.lang.String message)

getAcceptsNull

public boolean getAcceptsNull()
Returns false.

Specified by:
getAcceptsNull in interface Validator

renderContribution

public void renderContribution(IMarkupWriter writer,
                               IRequestCycle cycle,
                               FormComponentContributorContext context,
                               IFormComponent field)
Does nothing.

Specified by:
renderContribution in interface FormComponentContributor
Parameters:
writer - allows contributor to write additional attributes into the component's tag
cycle - for accessing request information
context - utilities for genering messages and client-side validation
field - the field for which contributions are being rendered

isRequired

public boolean isRequired()
Returns false. Subclasses may override.

Specified by:
isRequired in interface Validator