ValidateThis API Documentation

ValidateThis.client.jQuery
Class AbstractClientRuleScripter

WEB-INF.cftags.component
        extended by ValidateThis.client.jQuery.AbstractClientRuleScripter
Direct Known Subclasses:
ClientRuleScripter_Boolean , ClientRuleScripter_Custom , ClientRuleScripter_Date , ClientRuleScripter_DateRange , ClientRuleScripter_DoesNotContainOtherProperties , ClientRuleScripter_Email , ClientRuleScripter_EqualTo , ClientRuleScripter_False , ClientRuleScripter_FutureDate , ClientRuleScripter_InList , ClientRuleScripter_Integer , ClientRuleScripter_Max , ClientRuleScripter_MaxLength , ClientRuleScripter_Min , ClientRuleScripter_MinLength , ClientRuleScripter_MinPatternsMatch , ClientRuleScripter_NotInList , ClientRuleScripter_Numeric , ClientRuleScripter_PastDate , ClientRuleScripter_Range , ClientRuleScripter_RangeLength , ClientRuleScripter_Regex , ClientRuleScripter_Required , ClientRuleScripter_Time , ClientRuleScripter_True , ClientRuleScripter_URL , ClientRuleScripter_noHTML

public class AbstractClientRuleScripter
extends WEB-INF.cftags.component

I am a base object which all concrete ClientRuleScripters extend.


Constructor Summary
init(Any Translator, any messageHelper, string defaultFailureMessagePrefix)
          I build a new ClientRuleScripter
 
Method Summary
private any determineFailureMessage(any validation, string locale, any parameters)
          I determin the actual failure message to be used
 any generateAddMethod(any theMethod, string defaultMessage)
          I generate the JS script required to implement a validation
 any generateAddRule(any validation, Any locale, Any selector)
          I generate the JS script required to implement a validation
 any generateConditionJSON(any validation, Any formName, [Any locale=''])
          I generate the JSON object required to implement conditions for validations
 any generateRuleScript(any validation, Any locale, Any selector)
          I generate the JS script required to implement a validation
 any generateRuleStruct(any validation, Any locale, Any selector)
          I generate the JS script required to implement a validation
 any generateValidationJSON(any validation, Any locale, Any formName)
          I generate the JS JSON object required to implement the validations
 any generateValidationScript(any validation, Any locale, Any formName)
          I generate the JS script required to implement a validation
 string getConditionDef([any validation])
          I generate the JS script required to pass the appropriate depends conditions to the validator method
private any getCustomFailureMessage([any validation=''])
          I return the custom failure message from the validation object
private array getFailureArgs(any validation)
          I provide arguments needed to generate the failure message
private string getGeneratedFailureMessage([any validation], string locale, any parameters)
          I return the generated failure message from the resource bundle for this CRS
 string getMessageDef([string message='[runtime expression]'], [string valType='[runtime expression]'], [string locale=''])
          I generate the JS script required to display the appropriate failure message
 string getParameterDef([any validation])
          I generate the JS script required to pass the appropriate paramters to the validator method
 any getRuleDef(any validation, any parameters)
          I return just the rule definition which is required for the generateAddRule method
private string getSafeSelectorScript([any validation], [string formName=''])
          I generate the JS script required to select a property input element
private string getValType()
          I generate the JS script required to implement a validation
private string translate([string message=''], [string locale=''])
          I translate a message
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

Public init(Any Translator, any messageHelper, string defaultFailureMessagePrefix)
I build a new ClientRuleScripter

Parameters:
Translator
messageHelper
defaultFailureMessagePrefix
Method Detail

determineFailureMessage

private any determineFailureMessage(any validation, string locale, any parameters)
I determin the actual failure message to be used.

Parameters:
validation - The validation object that describes the validation.
locale - The locale to use to generate the default failure message.
parameters - The parameters stored in the validation object.

generateAddMethod

public any generateAddMethod(any theMethod, string defaultMessage)
I generate the JS script required to implement a validation.

Parameters:
theMethod - The JS method to use for the validator.
defaultMessage

generateAddRule

public any generateAddRule(any validation, Any locale, Any selector)
I generate the JS script required to implement a validation.

Parameters:
validation - The validation object that describes the validation.
locale
selector

generateConditionJSON

public any generateConditionJSON(any validation, Any formName, [Any locale=''])
I generate the JSON object required to implement conditions for validations.

Parameters:
validation - The validation object that describes the validation.
formName
locale

generateRuleScript

public any generateRuleScript(any validation, Any locale, Any selector)
I generate the JS script required to implement a validation.

Parameters:
validation - The validation object that describes the validation.
locale
selector

generateRuleStruct

public any generateRuleStruct(any validation, Any locale, Any selector)
I generate the JS script required to implement a validation.

Parameters:
validation - The validation object that describes the validation.
locale
selector

generateValidationJSON

public any generateValidationJSON(any validation, Any locale, Any formName)
I generate the JS JSON object required to implement the validations.

Parameters:
validation - The validation object that describes the validation.
locale
formName

generateValidationScript

public any generateValidationScript(any validation, Any locale, Any formName)
I generate the JS script required to implement a validation.

Parameters:
validation - The validation object that describes the validation.
locale
formName

getConditionDef

public string getConditionDef([any validation])
I generate the JS script required to pass the appropriate depends conditions to the validator method.

Parameters:
validation

getCustomFailureMessage

private any getCustomFailureMessage([any validation=''])
I return the custom failure message from the validation object.

Parameters:
validation

getFailureArgs

private array getFailureArgs(any validation)
I provide arguments needed to generate the failure message.

Parameters:
validation - The validation struct that describes the validation.

getGeneratedFailureMessage

private string getGeneratedFailureMessage([any validation], string locale, any parameters)
I return the generated failure message from the resource bundle for this CRS. Override me to customize further.

Parameters:
validation
locale - The locale to use to generate the default failure message.
parameters - The parameters stored in the validation object.

getMessageDef

public string getMessageDef([string message='[runtime expression]'], [string valType='[runtime expression]'], [string locale=''])
I generate the JS script required to display the appropriate failure message.

Parameters:
message
valType
locale

getParameterDef

public string getParameterDef([any validation])
I generate the JS script required to pass the appropriate paramters to the validator method.

Parameters:
validation

getRuleDef

public any getRuleDef(any validation, any parameters)
I return just the rule definition which is required for the generateAddRule method.

Parameters:
validation - The validation object that describes the validation.
parameters - The parameters stored in the validation object.

getSafeSelectorScript

private string getSafeSelectorScript([any validation], [string formName=''])
I generate the JS script required to select a property input element.

Parameters:
validation
formName

getValType

private string getValType()
I generate the JS script required to implement a validation.


translate

private string translate([string message=''], [string locale=''])
I translate a message.

Parameters:
message
locale

ValidateThis API Documentation