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

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

public static class StringValidator.ExactLengthValidator
extends StringValidator

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

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.ExactLengthValidator(int length)
          Constructor.
 
Method Summary
 int getLength()
          Retrieves the length value.
protected  void onValidate(IValidatable validatable)
          see AbstractValidator#onValidate(IValidatable)
protected  java.lang.String resourceKey()
          Gets the message resource key for this validator's error message from the ApplicationSettings class.
protected  java.util.Map variablesMap(IValidatable 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.ExactLengthValidator

public StringValidator.ExactLengthValidator(int length)
Constructor.

Parameters:
length - the length value
Method Detail

getLength

public final int getLength()
Retrieves the length value.

Returns:
the length value

onValidate

protected void onValidate(IValidatable validatable)
see AbstractValidator#onValidate(IValidatable)

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

resourceKey

protected java.lang.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
Returns:
the message resource key for this validator
See Also:
AbstractValidator.resourceKey()

variablesMap

protected java.util.Map variablesMap(IValidatable validatable)
Description copied from class: AbstractValidator
Gets the default Map of variables. NOTE: THIS METHOD SHOULD NEVER RETURN null.

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


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