org.apache.wicket.validation.validator
Class MinimumValidator<Z extends Comparable<Z> & Serializable>

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.apache.wicket.validation.validator.MinimumValidator<Z>
Type Parameters:
Z - type of validatable
All Implemented Interfaces:
Serializable, IClusterable, IComponentAwareEventSink, IComponentAwareHeaderContributor, IValidator<Z>

public class MinimumValidator<Z extends Comparable<Z> & Serializable>
extends Behavior
implements IValidator<Z>

Validator for checking that the value is not smaller then a specified minimum value

See Also:
Serialized Form

Constructor Summary
MinimumValidator(Z minimum)
          Constructor
 
Method Summary
 Z getMinimum()
          Gets the minimum value.
protected  String resourceKey()
          Gets the message resource key for this validator's error message from the ApplicationSettings class.
 void validate(IValidatable<Z> validatable)
          Validates the IValidatable instance.
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListenerInterface, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, renderHead, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinimumValidator

public MinimumValidator(Z minimum)
Constructor

Parameters:
minimum - the minimum value
Method Detail

validate

public void validate(IValidatable<Z> validatable)
Description copied from interface: IValidator
Validates the IValidatable instance. Validation errors should be reported using the IValidatable.error(IValidationError) method.

Specified by:
validate in interface IValidator<Z extends Comparable<Z> & Serializable>
Parameters:
validatable - the IValidatable instance being validated

getMinimum

public Z getMinimum()
Gets the minimum value.

Returns:
minimum value

resourceKey

protected String resourceKey()
Gets the message resource key for this validator's error message from the ApplicationSettings class. NOTE: THIS METHOD SHOULD NEVER RETURN null.

Returns:
the message resource key for this validator


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.