ValidateThis API Documentation

ValidateThis.core
Class BOValidator

WEB-INF.cftags.component
        extended by ValidateThis.core.BOValidator

public class BOValidator
extends WEB-INF.cftags.component

I am a validator responsible for holding validation rules for a business object.


Constructor Summary
init(string objectType, any FileSystem, any externalFileReader, any annotationReader, any ServerValidator, any ClientValidator, any TransientFactory, any CommonScriptGenerator, any Version, string defaultFormName, string defaultJSLib, string JSIncludes, string definitionPath, string specificDefinitionPath, any theObject, any componentPath, string debuggingMode, string defaultLocale)
          I build a new BOValidator
 
Method Summary
 void addRule(any propertyName, any valType, [any clientFieldName='[runtime expression]'], [any propertyDesc='[runtime expression]'], [Struct condition='[runtime expression]'], [Struct parameters='[runtime expression]'], [any contexts=''], [any failureMessage=''], [any formName=''])
          I am used to add a rule via CF code
 any determineFormName(any theArguments)
          I try to determine the form name by looking at the missing method arguments
private string determineLabel(string label)
 any determineLocale(any theArguments)
          I try to determine the locale by looking at the missing method arguments
private any determineRequiredPropertiesAndFields()
 any determineScriptType(any methodName)
          I try to determine the script type by looking at the missing method name
 boolean fieldIsRequired(any fieldName, [any context=''])
          I determine whether a field is required
 any fixDefaultContext(any Context)
 any getAllContexts()
 any getFormName(any Context)
 any getHashFromStruct(struct args)
 any getInitializationScript([any JSLib='[runtime expression]'], [Any JSIncludes='[runtime expression]'], [Any locale='[runtime expression]'])
          I generate JS statements required to setup client-side validations for VT
 any getObjectType()
          I get the BOValidator Object type
 string getPropertyDescription(string propertyName)
          Returns the descriptive name of a property
 any getRequiredFields([any Context=''])
 any getRequiredProperties([any Context=''])
 any getRequiredPropertiesAndDescs([string context=''])
 any getValidationClientFieldDescs()
 any getValidationFormContexts()
 any getValidationPropertyDescs()
 any getValidationRulesStruct([any Context=''], [any formName='[runtime expression]'], [any JSLib='[runtime expression]'], [Any locale='[runtime expression]'], [Any theObject=''])
          I generate the JS using the Client Validator script
 any getValidationScript([any Context=''], [any formName='[runtime expression]'], [any JSLib='[runtime expression]'], [Any locale='[runtime expression]'], [Any theObject=''])
          I generate the JS using the Client Validator script
 any getValidations([any Context=''])
 any getVersion()
          I report the current version of the framework
private void loadRulesFromAnnotations(any objectType, any theObject, any componentPath)
          I ask the externalFileReader to read the validations XML file and reformat it into a struct
private void loadRulesFromExternalFile(any objectType, any definitionPath)
          I ask the externalFileReader to read the validations XML file and reformat it into a struct
 void loadRulesFromStruct(struct theStruct)
          I take a struct of validation data and call addrule for each validation
 any newBusinessObjectWrapper(any theObject)
          I create a BusinessObjectWrapper object
 any newResult()
          I create a Result object
 Any onMissingMethod(any missingMethodName, any missingMethodArguments)
          This is used to eliminate the need for duplicate methods which all just pass calls on to the Client Validator
 boolean propertyIsRequired(any propertyName, [any Context=''])
          I determine whether a property is required
 any validate(any theObject, [any Context=''], [any Result=''], [array objectList='[runtime expression]'], [string debuggingMode='[runtime expression]'], [boolean ignoreMissingProperties='false'], [string locale='[runtime expression]'])
          I perform the validations using the Server Validator, returning info in the result object
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(string objectType, any FileSystem, any externalFileReader, any annotationReader, any ServerValidator, any ClientValidator, any TransientFactory, any CommonScriptGenerator, any Version, string defaultFormName, string defaultJSLib, string JSIncludes, string definitionPath, string specificDefinitionPath, any theObject, any componentPath, string debuggingMode, string defaultLocale)
I build a new BOValidator

Parameters:
objectType
FileSystem
externalFileReader
annotationReader
ServerValidator
ClientValidator
TransientFactory
CommonScriptGenerator
Version
defaultFormName
defaultJSLib
JSIncludes
definitionPath
specificDefinitionPath
theObject - The object from which to read annotations, a blank means no object was passed
componentPath - The component path to the object - used to read annotations using getComponentMetadata
debuggingMode - The debuggingMode from the VTConfig struct
defaultLocale - The defaultLocale for the resource bundle
Method Detail

addRule

public void addRule(any propertyName, any valType, [any clientFieldName='[runtime expression]'], [any propertyDesc='[runtime expression]'], [Struct condition='[runtime expression]'], [Struct parameters='[runtime expression]'], [any contexts=''], [any failureMessage=''], [any formName=''])
I am used to add a rule via CF code

Parameters:
propertyName
valType
clientFieldName
propertyDesc
condition
parameters
contexts
failureMessage
formName

determineFormName

public any determineFormName(any theArguments)
I try to determine the form name by looking at the missing method arguments.

Parameters:
theArguments

determineLabel

private string determineLabel(string label)

Parameters:
label

determineLocale

public any determineLocale(any theArguments)
I try to determine the locale by looking at the missing method arguments.

Parameters:
theArguments

determineRequiredPropertiesAndFields

private any determineRequiredPropertiesAndFields()


determineScriptType

public any determineScriptType(any methodName)
I try to determine the script type by looking at the missing method name.

Parameters:
methodName

fieldIsRequired

public boolean fieldIsRequired(any fieldName, [any context=''])
I determine whether a field is required.

Parameters:
fieldName - The name of the property.
context

fixDefaultContext

public any fixDefaultContext(any Context)

Parameters:
Context

getAllContexts

public any getAllContexts()


getFormName

public any getFormName(any Context)

Parameters:
Context

getHashFromStruct

public any getHashFromStruct(struct args)

Parameters:
args

getInitializationScript

public any getInitializationScript([any JSLib='[runtime expression]'], [Any JSIncludes='[runtime expression]'], [Any locale='[runtime expression]'])
I generate JS statements required to setup client-side validations for VT.

Parameters:
JSLib
JSIncludes
locale

getObjectType

public any getObjectType()
I get the BOValidator Object type.


getPropertyDescription

public string getPropertyDescription(string propertyName)
Returns the descriptive name of a property

Parameters:
propertyName

getRequiredFields

public any getRequiredFields([any Context=''])

Parameters:
Context

getRequiredProperties

public any getRequiredProperties([any Context=''])

Parameters:
Context

getRequiredPropertiesAndDescs

public any getRequiredPropertiesAndDescs([string context=''])

Parameters:
context

getValidationClientFieldDescs

public any getValidationClientFieldDescs()


getValidationFormContexts

public any getValidationFormContexts()


getValidationPropertyDescs

public any getValidationPropertyDescs()


getValidationRulesStruct

public any getValidationRulesStruct([any Context=''], [any formName='[runtime expression]'], [any JSLib='[runtime expression]'], [Any locale='[runtime expression]'], [Any theObject=''])
I generate the JS using the Client Validator script.

Parameters:
Context
formName - The name of the form for which validations are being generated.
JSLib
locale
theObject

getValidationScript

public any getValidationScript([any Context=''], [any formName='[runtime expression]'], [any JSLib='[runtime expression]'], [Any locale='[runtime expression]'], [Any theObject=''])
I generate the JS using the Client Validator script.

Parameters:
Context
formName - The name of the form for which validations are being generated.
JSLib
locale
theObject

getValidations

public any getValidations([any Context=''])

Parameters:
Context

getVersion

public any getVersion()
I report the current version of the framework


loadRulesFromAnnotations

private void loadRulesFromAnnotations(any objectType, any theObject, any componentPath)
I ask the externalFileReader to read the validations XML file and reformat it into a struct

Parameters:
objectType
theObject
componentPath

loadRulesFromExternalFile

private void loadRulesFromExternalFile(any objectType, any definitionPath)
I ask the externalFileReader to read the validations XML file and reformat it into a struct

Parameters:
objectType
definitionPath

loadRulesFromStruct

public void loadRulesFromStruct(struct theStruct)
I take a struct of validation data and call addrule for each validation

Parameters:
theStruct

newBusinessObjectWrapper

public any newBusinessObjectWrapper(any theObject)
I create a BusinessObjectWrapper object.

Parameters:
theObject

newResult

public any newResult()
I create a Result object.


onMissingMethod

public Any onMissingMethod(any missingMethodName, any missingMethodArguments)
This is used to eliminate the need for duplicate methods which all just pass calls on to the Client Validator.

Parameters:
missingMethodName
missingMethodArguments

propertyIsRequired

public boolean propertyIsRequired(any propertyName, [any Context=''])
I determine whether a property is required.

Parameters:
propertyName - The name of the property.
Context

validate

public any validate(any theObject, [any Context=''], [any Result=''], [array objectList='[runtime expression]'], [string debuggingMode='[runtime expression]'], [boolean ignoreMissingProperties='false'], [string locale='[runtime expression]'])
I perform the validations using the Server Validator, returning info in the result object.

Parameters:
theObject
Context
Result
objectList
debuggingMode
ignoreMissingProperties
locale

ValidateThis API Documentation