org.javalite.activejdbc.validation
Class RangeValidator

java.lang.Object
  extended by org.javalite.activejdbc.validation.RangeValidator
All Implemented Interfaces:
Validator

public class RangeValidator
extends Object
implements Validator


Constructor Summary
RangeValidator(String attribute, Number min, Number max)
           
 
Method Summary
 String formatMessage(Locale locale, Object... params)
          Formats a message with locale.
 void setMessage(String message)
          Sets an message on this validator.
 void validate(Model m)
          Called by framework when a Model.validate() method called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeValidator

public RangeValidator(String attribute,
                      Number min,
                      Number max)
Method Detail

setMessage

public void setMessage(String message)
Description copied from interface: Validator
Sets an message on this validator.

Specified by:
setMessage in interface Validator
Parameters:
message - error message.

validate

public void validate(Model m)
Description copied from interface: Validator
Called by framework when a Model.validate() method called.

Specified by:
validate in interface Validator
Parameters:
m - model being validated.

formatMessage

public String formatMessage(Locale locale,
                            Object... params)
Description copied from interface: Validator
Formats a message with locale.

Specified by:
formatMessage in interface Validator
Parameters:
locale - locale to use.
params - parameters in case a message is parametrized.
Returns:
formatted message


Copyright © 2013. All Rights Reserved.