org.javalite.activejdbc.validation
Class RangeValidator

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

public class RangeValidator
extends ValidatorAdapter


Constructor Summary
RangeValidator(String attribute, Number min, Number max)
           
 
Method Summary
 String formatMessage(Locale locale, Object... params)
          Provides default implementation, will look for a property in resource bundle, using set message as key.
 void validate(Model m)
          Called by framework when a Model.validate() method called.
 
Methods inherited from class org.javalite.activejdbc.validation.ValidatorAdapter
getMessage, setMessage
 
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

validate

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

Parameters:
m - model being validated.

formatMessage

public String formatMessage(Locale locale,
                            Object... params)
Description copied from class: ValidatorAdapter
Provides default implementation, will look for a property in resource bundle, using set message as key. If property in resource bundle not found, treats message verbatim.

Specified by:
formatMessage in interface Validator
Overrides:
formatMessage in class ValidatorAdapter
Parameters:
locale - locale to use, or null for default locale.
params - parameters in case a message is parametrized.
Returns:
formatted message.


Copyright © 2015 JavaLite. All rights reserved.