wicket.markup.html.form.validation
Class RequiredValidator

java.lang.Object
  extended by wicket.markup.html.form.validation.AbstractValidator
      extended by wicket.markup.html.form.validation.RequiredValidator
All Implemented Interfaces:
java.io.Serializable, IValidator

Deprecated.

public class RequiredValidator
extends AbstractValidator

This validator has been deprecated in favor of FormComponent.setRequired(boolean) Validator that ensures a component has a non-null and non-empty value. If the component's value is null or empty (a value is considered empty if it just contains whitespace) when its containing form is submitted then the errorMessage() method will be called by the framework.

Author:
Jonathan Locke
See Also:
Serialized Form

Constructor Summary
protected RequiredValidator()
          Deprecated. Protectected constructor to force use of static singleton accessor method.
 
Method Summary
static RequiredValidator getInstance()
          Deprecated.  
 void onValidate(FormComponent formComponent, java.lang.String value)
          Deprecated. Validates whether the input value is not-null or empty.
 java.lang.String toString()
          Deprecated.  
 void validate(FormComponent component)
          Deprecated.  Instead of subclassing IValidator, you should use one of the existing validators, which cover a huge number of cases, or if none satisfies your need, subclass one of the Type validators like StringValidator, NumberValidator or DateValidator
 
Methods inherited from class wicket.markup.html.form.validation.AbstractValidator
error, error, error, error, messageModel, resourceKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequiredValidator

protected RequiredValidator()
Deprecated. 
Protectected constructor to force use of static singleton accessor method. Or override it to implement resourceKey(Component)

Method Detail

getInstance

public static RequiredValidator getInstance()
Deprecated. 
Returns:
Instance of required validator

validate

public void validate(FormComponent component)
Deprecated. 
Description copied from interface: IValidator

Instead of subclassing IValidator, you should use one of the existing validators, which cover a huge number of cases, or if none satisfies your need, subclass one of the Type validators like StringValidator, NumberValidator or DateValidator

Validates the given input. The input corresponds to the input from the request for a component.

Parameters:
component - Component to validate
See Also:
IValidator.validate(wicket.markup.html.form.FormComponent)

onValidate

public final void onValidate(FormComponent formComponent,
                             java.lang.String value)
Deprecated. 
Validates whether the input value is not-null or empty. Validation is only executed when the component is enabled. If the value is null and the form component is not input nullable (FormComponent.isInputNullable(), that is interpreted as the component being disabled too. If that is the case, validation will not be executed.

Parameters:
formComponent - The form component that is checked
value - The input value of the formcomponent (not converted value)
See Also:
StringValidator.onValidate(wicket.markup.html.form.FormComponent, java.lang.String)

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2007 Wicket developers. All Rights Reserved.