org.apache.wicket.validation.validator
Class StringValidator.ExactLengthValidator
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.validation.validator.AbstractValidator<java.lang.String>
org.apache.wicket.validation.validator.StringValidator
org.apache.wicket.validation.validator.StringValidator.ExactLengthValidator
- All Implemented Interfaces:
- java.io.Serializable, IClusterable, IComponentAwareEventSink, IComponentAwareHeaderContributor, INullAcceptingValidator<java.lang.String>, IValidator<java.lang.String>
- 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
Method Summary |
int |
getLength()
Retrieves the length value. |
protected void |
onValidate(IValidatable<java.lang.String> 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<java.lang.String,java.lang.Object> |
variablesMap(IValidatable<java.lang.String> validatable)
Gets the default Map of variables. |
Methods inherited from class org.apache.wicket.behavior.Behavior |
afterRender, beforeRender, bind, 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 |
StringValidator.ExactLengthValidator
public StringValidator.ExactLengthValidator(int length)
- Constructor.
- Parameters:
length
- the length value
getLength
public final int getLength()
- Retrieves the length value.
- Returns:
- the length value
onValidate
protected void onValidate(IValidatable<java.lang.String> validatable)
- see AbstractValidator#onValidate(IValidatable)
- Specified by:
onValidate
in class AbstractValidator<java.lang.String>
- 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<java.lang.String>
- Returns:
- the message resource key for this validator
- See Also:
AbstractValidator.resourceKey()
variablesMap
protected java.util.Map<java.lang.String,java.lang.Object> variablesMap(IValidatable<java.lang.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<java.lang.String>
- Parameters:
validatable
- the IValidatable
instance being validated
- Returns:
- a
Map
of variables for variable interpolation - See Also:
AbstractValidator.variablesMap(IValidatable)
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.