org.apache.tapestry.form.validator
Class Max

java.lang.Object
  extended byorg.apache.tapestry.form.validator.BaseValidator
      extended byorg.apache.tapestry.form.validator.Max
All Implemented Interfaces:
FormComponentContributor, Validator

public class Max
extends BaseValidator

Validates that the input value is not larger than a particular maximum value.

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
Max()
           
Max(java.lang.String initializer)
           
 
Method Summary
 void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
          Does nothing.
 void setMax(double max)
           
 void validate(IFormComponent field, ValidationMessages messages, java.lang.Object object)
          Does comparison based on the Number.doubleValue().
 
Methods inherited from class org.apache.tapestry.form.validator.BaseValidator
getAcceptsNull, getMessage, isRequired, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Max

public Max()

Max

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

validate

public void validate(IFormComponent field,
                     ValidationMessages messages,
                     java.lang.Object object)
              throws ValidatorException
Does comparison based on the Number.doubleValue().

Parameters:
field - the form element component being validated, often used to determine the user presentable name for the field, used in error messages.
messages - access to the pre-defined validation messages, in the appropriate locale
object - the client-side representation of the field's data. May be null if the client did not provide a value for the field (most Validators should check for null and perform no check if null).
Throws:
ValidatorException - if the object violates the constraint represented by this Validator.

renderContribution

public void renderContribution(IMarkupWriter writer,
                               IRequestCycle cycle,
                               FormComponentContributorContext context,
                               IFormComponent field)
Description copied from class: BaseValidator
Does nothing.

Specified by:
renderContribution in interface FormComponentContributor
Overrides:
renderContribution in class BaseValidator

setMax

public void setMax(double max)