com.esri.adf.web.data.tasks.validator
Class StringValidator

java.lang.Object
  extended by com.esri.adf.web.data.tasks.validator.GenericValidator
      extended by com.esri.adf.web.data.tasks.validator.StringValidator
All Implemented Interfaces:
TaskParamValidator, Serializable

public class StringValidator
extends GenericValidator

This class is used to define the validation rules to be enforced on a Task parameter that accepts text.

 For Example,
   TaskParamDescriptor paramDescriptor = ...;
   StringValidator strValidator = new StringValidator();
   strValidator.setRequired(true);
   strValidator.setRegExp("[A-Za-z]*");
   strValidator.setTrim(true);
   paramDescriptor.setValidator(strValidator);
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.esri.adf.web.data.tasks.validator.GenericValidator
ADFDOJOTYPE
 
Constructor Summary
StringValidator()
           
 
Method Summary
 String getRegExp()
          Specifies the regular expression to validate the text against.
 boolean isConvertToLowerCase()
          Specifies whether all characters should be automatically converted to lower case.
 boolean isConvertToUpperCase()
          Specifies whether all characters should be automatically converted to upper case.
 boolean isProperCase()
          Specifies whether the first character in every word should be automatically converted to upper case.
 boolean isTrim()
          Specifies whether the leading and trailing whitespace(s) should be automatically trimmed from the text.
 void setConvertToLowerCase(boolean convertToLowerCase)
          Specifies whether all characters should be automatically converted to lower case.
 void setConvertToUpperCase(boolean convertToUpperCase)
          Specifies whether all characters should be automatically converted to upper case.
 void setProperCase(boolean properCase)
          Specifies whether the first character in every word should be automatically converted to upper case.
 void setRegExp(String regExp)
          Specifies the regular expression to validate the text against.
 void setTrim(boolean trim)
          Specifies whether the leading and trailing whitespace(s) should be automatically trimmed from the text.
 
Methods inherited from class com.esri.adf.web.data.tasks.validator.GenericValidator
addValidationRule, getInvalidMessage, getPromptMessage, getValidationRules, isRequired, removeValidationRule, setInvalidMessage, setPromptMessage, setRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValidator

public StringValidator()
Method Detail

isConvertToLowerCase

public boolean isConvertToLowerCase()
Specifies whether all characters should be automatically converted to lower case. Default is false.

Returns:
true if the characters should be converted to lower case, false otherwise.

setConvertToLowerCase

public void setConvertToLowerCase(boolean convertToLowerCase)
Specifies whether all characters should be automatically converted to lower case. Default is false.

Parameters:
convertToLowerCase - specifies whether the characters should be converted to lower case.

isConvertToUpperCase

public boolean isConvertToUpperCase()
Specifies whether all characters should be automatically converted to upper case. Default is false.

Returns:
true if the characters should be converted to upper case, false otherwise.

setConvertToUpperCase

public void setConvertToUpperCase(boolean convertToUpperCase)
Specifies whether all characters should be automatically converted to upper case. Default is false.

Parameters:
convertToUpperCase - specifies whether the characters should be converted to upper case.

isProperCase

public boolean isProperCase()
Specifies whether the first character in every word should be automatically converted to upper case. Default is true.

Returns:
true if the first character in every word should be converted to upper case, false otherwise.

setProperCase

public void setProperCase(boolean properCase)
Specifies whether the first character in every word should be automatically converted to upper case. Default is true.

Parameters:
properCase - specifies whether the first character in every word should be converted to upper case.

isTrim

public boolean isTrim()
Specifies whether the leading and trailing whitespace(s) should be automatically trimmed from the text. Default is false.

Returns:
true if the whitespace(s) should be trimmed, false otherwise.

setTrim

public void setTrim(boolean trim)
Specifies whether the leading and trailing whitespace(s) should be automatically trimmed from the text. Default is false.

Parameters:
trim - specifies whether the whitespace(s) should be trimmed.

getRegExp

public String getRegExp()
Specifies the regular expression to validate the text against.

Returns:
the regular expression.

setRegExp

public void setRegExp(String regExp)
Specifies the regular expression to validate the text against.

Parameters:
regExp - the regular expression.