com.sas.servlet.tbeans.util.validators
Class JavaScriptValidator

com.sas.servlet.tbeans.util.validators.JavaScriptValidator
All Implemented Interfaces:
JavaScriptValidationInterface, com.sas.servlet.tbeans.util.validators.JavaScriptValidationObjectCreationInterface, com.sas.servlet.tbeans.util.validators.JavaScriptValidationOnChangeInterface, ValidationInterface, java.io.Serializable
Direct Known Subclasses:
DateStringValidator, HexColorStringValidator, IntegerInputValidator, MaximumLengthValidator, MaximumValueValidator, MinimumValueValidator, NumericInputValidator, RequiredStringValidator

public class JavaScriptValidator
implements com.sas.servlet.tbeans.util.validators.JavaScriptValidationOnChangeInterface, com.sas.servlet.tbeans.util.validators.JavaScriptValidationObjectCreationInterface

The JavaScriptValidator is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript for creating a validator. This is the base validator class which provides a default implementation of the ValidationInterface. Validator also provides a base framework for creating, storing, and overriding Message objects used during the validation.

Note that subclasses of this bean actually provide the markup rendering used in/with Servlet and JavaServer Pages technologies. If you need to add support for a markup language that is not explicitly provided with AppDev Studio, then you must extend this class.

For More Information:

Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sas.util.validators.Validator
message, messages, msgObject
 
Constructor Summary
JavaScriptValidator()
          Construct a new Validator object
 
Method Summary
 java.lang.String createValidationFunctionCall(TransformationInterface bean)
          Returns a String containing the entire Javascript validation function call.
 java.lang.String getClearErrorsFunctionName()
          Gets the name of the clear errors function.
protected  java.lang.String getDefaultValidationMessage(TransformationInterface bean)
           
protected  java.lang.String getDescription(TransformationInterface bean)
           
 java.lang.String getErrorHandlerFunctionName()
          Gets the name of the error handler function.
 java.lang.String getValidationFunctionName()
          Gets the name of the validation function.
protected  java.lang.String getValidationParameters(TransformationInterface bean)
           
 void setClearErrorsFunctionName(java.lang.String name)
          Sets the name of the clear errors JavaScript function to call to clear all validations that have failed.
 void setErrorHandlerFunctionName(java.lang.String name)
          Sets the name of the error handler function to call if validation fails.
 void setValidationFunctionName(java.lang.String name)
          Sets the name of the JavaScript validation function to call for validation if there
 
Methods inherited from class com.sas.util.validators.Validator
createValidationMessages, getExtendedBeanInfo, getValidationMessage, getValidationMessageCode, newValidationMessage, normalizeValue, setValidationMessage, setValidationMessageCode, validateValue
 
Methods inherited from interface com.sas.util.validators.ValidationInterface
getValidationMessage, getValidationMessageCode, normalizeValue, setValidationMessage, validateValue
 

Constructor Detail

JavaScriptValidator

public JavaScriptValidator()
Construct a new Validator object

Method Detail

setValidationFunctionName

public void setValidationFunctionName(java.lang.String name)
Sets the name of the JavaScript validation function to call for validation if there

Specified by:
setValidationFunctionName in interface JavaScriptValidationInterface
Parameters:
name - The JavaScript validation function name

getValidationFunctionName

public java.lang.String getValidationFunctionName()
Gets the name of the validation function.

Specified by:
getValidationFunctionName in interface JavaScriptValidationInterface
Returns:
The JavaScript validation function name

setErrorHandlerFunctionName

public void setErrorHandlerFunctionName(java.lang.String name)
Sets the name of the error handler function to call if validation fails.

Specified by:
setErrorHandlerFunctionName in interface JavaScriptValidationInterface
Parameters:
name - The error handler function name

getErrorHandlerFunctionName

public java.lang.String getErrorHandlerFunctionName()
Gets the name of the error handler function.

Specified by:
getErrorHandlerFunctionName in interface JavaScriptValidationInterface
Returns:
The error handler function name

setClearErrorsFunctionName

public void setClearErrorsFunctionName(java.lang.String name)
Sets the name of the clear errors JavaScript function to call to clear all validations that have failed.

Specified by:
setClearErrorsFunctionName in interface JavaScriptValidationInterface
Parameters:
name - The clear errors function name

getClearErrorsFunctionName

public java.lang.String getClearErrorsFunctionName()
Gets the name of the clear errors function.

Specified by:
getClearErrorsFunctionName in interface JavaScriptValidationInterface
Returns:
The clear errors function name

createValidationFunctionCall

public java.lang.String createValidationFunctionCall(TransformationInterface bean)
Returns a String containing the entire Javascript validation function call. Subclasses should override this method and implement their own createValidationFunctionCall.

Specified by:
createValidationFunctionCall in interface JavaScriptValidationInterface
Parameters:
bean - The transformation bean validation has been set on.
Returns:
functionCall The JavaScript validation function call.

getDefaultValidationMessage

protected java.lang.String getDefaultValidationMessage(TransformationInterface bean)

getValidationParameters

protected java.lang.String getValidationParameters(TransformationInterface bean)

getDescription

protected java.lang.String getDescription(TransformationInterface bean)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.