wicket.markup.html.form.validation
Class TypeValidator

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

Deprecated.

public class TypeValidator
extends StringValidator

This validator has been depreacted in favor of FormComponent.setType(Class) Validates input by trying it to convert to the given type using the IConverterinstance of the component doing the validation.

This component adds ${type}, ${exception}, ${locale} and ${format} to the model for error message interpolation. Format is only valid if the type conversion involves a date.

Author:
Eelco Hillenius, Jonathan Locke
See Also:
Serialized Form

Constructor Summary
TypeValidator(java.lang.Class type)
          Deprecated. Constructor.
TypeValidator(java.lang.Class type, java.util.Locale locale)
          Deprecated. Construct.
 
Method Summary
 java.lang.Class getType()
          Deprecated. Gets the type to use for checking.
protected  java.util.Map messageModel(FormComponent formComponent, ConversionException e)
          Deprecated. Gets the message context.
 void onValidate(FormComponent formComponent, java.lang.String value)
          Deprecated. Validates input by trying it to convert to the given type using the IConverterinstance of the component doing the validation.
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class wicket.markup.html.form.validation.StringValidator
exactLength, lengthBetween, maximumLength, minimumLength, validate
 
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

TypeValidator

public TypeValidator(java.lang.Class type)
Deprecated. 
Constructor. The current session's locale will be used for conversion.

Parameters:
type - The type to use for checking

TypeValidator

public TypeValidator(java.lang.Class type,
                     java.util.Locale locale)
Deprecated. 
Construct. If not-null, the given locale will be used for conversion. Otherwise the session's locale will be used for conversion.

Parameters:
type - The type to use for checking
locale - The locale to use
Method Detail

getType

public final java.lang.Class getType()
Deprecated. 
Gets the type to use for checking.

Returns:
the type to use for checking

onValidate

public void onValidate(FormComponent formComponent,
                       java.lang.String value)
Deprecated. 
Validates input by trying it to convert to the given type using the IConverterinstance of the component doing the validation.

Specified by:
onValidate in class StringValidator
Parameters:
formComponent - form component
value - The string value to validate
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()

messageModel

protected java.util.Map messageModel(FormComponent formComponent,
                                     ConversionException e)
Deprecated. 
Gets the message context.

Parameters:
formComponent - form component
e - the conversion exception
Returns:
a map with variables for interpolation


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