com.sapportals.htmlb.validation

Class LengthValidator

java.lang.Object
  extended bycom.sapportals.htmlb.validation.Validator
      extended bycom.sapportals.htmlb.validation.LengthValidator

public class LengthValidator
extends Validator


Constructor Summary
LengthValidator(int length)
          constructor constructs a length validator with the specified length
LengthValidator(int minlength, int maxlength)
          constructor constructs a length validator with the specified minimal and maximal length
 
Method Summary
 String getErrorText(Locale locale)
          returns a locale specific error text
 String getJavascript(Locale locale)
          returns the java script function that's used to validate if input suits pattern Note: the java script function can be locale dependent
 
Methods inherited from class com.sapportals.htmlb.validation.Validator
getResourceBundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthValidator

public LengthValidator(int length)
constructor constructs a length validator with the specified length

Parameters:
length - the integer that specified the maximal length of the input that is allowed

LengthValidator

public LengthValidator(int minlength,
                       int maxlength)
constructor constructs a length validator with the specified minimal and maximal length

Parameters:
minlength - the integer that specified the minimal length of the input
Method Detail

getJavascript

public String getJavascript(Locale locale)
returns the java script function that's used to validate if input suits pattern Note: the java script function can be locale dependent

Specified by:
getJavascript in class Validator
Parameters:
locale - the locale information
Returns:
a String representation of Javascript

getErrorText

public String getErrorText(Locale locale)
returns a locale specific error text

Specified by:
getErrorText in class Validator
Parameters:
locale - the locale for which to format the value
Returns:
the locale specific error text which can contain the defined pattern


Copyright 2006 SAP AG Complete Copyright Notice