com.smartgwt.client.widgets.form.validator
Class MaskValidator

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.widgets.form.validator.Validator
              extended by com.smartgwt.client.widgets.form.validator.MaskValidator

public class MaskValidator
extends Validator

Validate against a regular expression mask, specified as validator.mask. If validation is successful a transformation can also be specified via the validator.transformTo property. This should be set to a string in the standard format for string replacement via the native JavaScript replace() method.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
MaskValidator()
           
 
Method Summary
 String getMask()
          Return the mask.
 String getTransformTo()
          Return the transformTo.
 void setMask(String mask)
          Set the mask.
 void setTransformTo(String transformTo)
          Set the transformTo.
 
Methods inherited from class com.smartgwt.client.widgets.form.validator.Validator
getClientOnly, getOrCreateRef, getServerCondition, getServerOnly, getStopIfFalse, setClientOnly, setErrorMessage, setServerCondition, setServerOnly, setStopIfFalse
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsObject, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
isCreated, setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaskValidator

public MaskValidator()
Method Detail

setMask

public void setMask(String mask)
Set the mask. Eg : ^\s*(1?)\s*\(?\s*(\d{3})\s*\)?\s*-?\s*(\d{3})\s*-?\s*(\d{4})\s*$

Parameters:
mask - the mask

getMask

public String getMask()
Return the mask.

Returns:
the mask

setTransformTo

public void setTransformTo(String transformTo)
Set the transformTo. Eg : $1($2) $3 - $4

Parameters:
transformTo - the transformTo

getTransformTo

public String getTransformTo()
Return the transformTo.

Returns:
the transformTo