org.apache.wicket.validation.validator
Class StringValidator.LengthBetweenValidator

java.lang.Object
  extended by org.apache.wicket.validation.validator.AbstractValidator<String>
      extended by org.apache.wicket.validation.validator.StringValidator
          extended by org.apache.wicket.validation.validator.StringValidator.LengthBetweenValidator
All Implemented Interfaces:
Serializable, IClusterable, INullAcceptingValidator<String>, IValidator<String>
Enclosing class:
StringValidator

public static class StringValidator.LengthBetweenValidator
extends StringValidator

Validator for checking if the length of a String is within the specified range.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.wicket.validation.validator.StringValidator
StringValidator.ExactLengthValidator, StringValidator.LengthBetweenValidator, StringValidator.MaximumLengthValidator, StringValidator.MinimumLengthValidator
 
Constructor Summary
StringValidator.LengthBetweenValidator(int minimum, int maximum)
          Constructor that sets the minimum and maximum values.
 
Method Summary
 int getMaximum()
          Retrieves the maximum value.
 int getMinimum()
          Retrieves the minimum value.
protected  void onValidate(IValidatable<String> validatable)
          see AbstractValidator#onValidate(IValidatable)
protected  String resourceKey()
          Gets the message resource key for this validator's error message from the ApplicationSettings class.
protected  Map<String,Object> variablesMap(IValidatable<String> validatable)
          Gets the default Map of variables.
 
Methods inherited from class org.apache.wicket.validation.validator.StringValidator
exactLength, lengthBetween, maximumLength, minimumLength
 
Methods inherited from class org.apache.wicket.validation.validator.AbstractValidator
error, error, error, error, messageModel, resourceKey, validate, validate, validateOnNullValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValidator.LengthBetweenValidator

public StringValidator.LengthBetweenValidator(int minimum,
                                              int maximum)
Constructor that sets the minimum and maximum values.

Parameters:
minimum - the minimum value
maximum - the maximum value
Method Detail

getMaximum

public final int getMaximum()
Retrieves the maximum value.

Returns:
the maximum value

getMinimum

public final int getMinimum()
Retrieves the minimum value.

Returns:
the minimum value

onValidate

protected void onValidate(IValidatable<String> validatable)
see AbstractValidator#onValidate(IValidatable)

Specified by:
onValidate in class AbstractValidator<String>
Parameters:
validatable - the given IValidatable instance

resourceKey

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

Overrides:
resourceKey in class AbstractValidator<String>
Returns:
the message resource key for this validator
See Also:
AbstractValidator.resourceKey()

variablesMap

protected Map<String,Object> variablesMap(IValidatable<String> validatable)
Description copied from class: AbstractValidator
Gets the default Map of variables. NOTE: THIS METHOD SHOULD NEVER RETURN null.

Overrides:
variablesMap in class AbstractValidator<String>
Parameters:
validatable - the IValidatable instance being validated
Returns:
a Map of variables for variable interpolation
See Also:
AbstractValidator.variablesMap(IValidatable)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.