ValidateThis API Documentation

ValidateThis.util
Class Result

WEB-INF.cftags.component
        extended by ValidateThis.util.Result

public class Result
extends WEB-INF.cftags.component

I am a transient result object.


Constructor Summary
Init(any Translator, struct ValidateThisConfig)
          I am the constructor
 
Method Summary
 struct GetErrors([Any locale='[runtime expression]'])
          I get the Error collection as expected from ModelGlue
 boolean HasErrors([string PropertyName=''])
          I implement part of the ModelGlue
 void Merge(any ValidationErrorCollection)
          I merge a ModelGlue
 void addFailure([struct failure='[runtime expression]'], [string propertyName=''], [string clientFieldName='[runtime expression]'], [string type=''], [string message=''], [any theObject=''], [string objectType=''])
          adds a Failure to the collection of failures in the object
 void addResult(any theResult)
          Pass in a Result object and I will add it to the current Result object
 array getDebugging()
          I return an array of rules/conditions which have been evaluated
 string getDebuggingMode()
          I return the debugging mode
 array getFailureMessages([Any locale='[runtime expression]'])
          I return all failure messages as an array of strings
 struct getFailureMessagesByField([Any limit=''], [string delimiter=''], [Any locale='[runtime expression]'])
          Returns a structure containing a list of failure messages for each clientFieldName
 struct getFailureMessagesByProperty([Any limit=''], [string delimiter=''], [Any locale='[runtime expression]'])
          Returns a structure containing a list of failure messages for each propertyName
 any getFailures([Any locale='[runtime expression]'])
          returns all failures as an array of structs
 any getFailuresAsString([string delim='
'], [Any locale='[runtime expression]'])

          I return the errors as a string separated with a specified delimiter
 any getFailuresAsStruct([Any locale='[runtime expression]'])
          Deprecated
 any getFailuresAsValidationErrorCollection([Any locale='[runtime expression]'])
          I return failures in a format expected from a ModelGlue
 struct getFailuresByField([Any limit=''], [Any locale='[runtime expression]'])
          Returns a structure containing an array of failures for each clientFieldName
private struct getFailuresByFieldOrProperty(Any keyType, boolean messageOnly, [Any limit=''], [string delimiter=''], [Any locale='[runtime expression]'])
          Returns a structure containing an array of failures for each propertyName
 struct getFailuresByProperty([Any limit=''], [Any locale='[runtime expression]'])
          Returns a structure containing an array of failures for each propertyName
 any getFailuresForUniForm([Any locale='[runtime expression]'])
          Returns a structure of failures in a format the cfUniform likes
 boolean getIsSuccess()
 any getMemento()
 any getRawFailures()
          returns the internal array of failure structs
 any getSuccessMessage()
 any getTheObject()
 void logCriteriaOutcome(string classname, string context, any criteria, string passed)
          I log the outcome when a rule/condition is evaluated
 any onMissingMethod(string MissingMethodName, struct MissingMethodArguments)
          provides for generic getter/setter
 void setIsSuccess(boolean IsSuccess)
 void setSuccessMessage(any SuccessMessage)
 void setTheObject(any theObject)
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

Init

Public Init(any Translator, struct ValidateThisConfig)
I am the constructor

Parameters:
Translator
ValidateThisConfig
Method Detail

GetErrors

public struct GetErrors([Any locale='[runtime expression]'])
I get the Error collection as expected from ModelGlue.util.ValidationErrorCollection.

Parameters:
locale

HasErrors

public boolean HasErrors([string PropertyName=''])
I implement part of the ModelGlue.util.ValidationErrorCollection interface.

Parameters:
PropertyName - You can check for errors on a specific property by passing me.

Merge

public void Merge(any ValidationErrorCollection)
I merge a ModelGlue.util.ValidationErrorCollection's errors into this result.

Parameters:
ValidationErrorCollection - I am the Result to merge.

addFailure

public void addFailure([struct failure='[runtime expression]'], [string propertyName=''], [string clientFieldName='[runtime expression]'], [string type=''], [string message=''], [any theObject=''], [string objectType=''])
adds a Failure to the collection of failures in the object.

Parameters:
failure - a struct with keys describing the failure. It must contain a Message key if it is the only argument passed
propertyName - The name of the property that caused the failure
clientFieldName - The name of the form field that caused the failure
type - The type of validation that caused the failure
message - The message to be displayed
theObject - The object that was being validated
objectType - The type of object that was being validated

addResult

public void addResult(any theResult)
Pass in a Result object and I will add it to the current Result object.

Parameters:
theResult

getDebugging

public array getDebugging()
I return an array of rules/conditions which have been evaluated


getDebuggingMode

public string getDebuggingMode()
I return the debugging mode. Possible values: none|info|strict


getFailureMessages

public array getFailureMessages([Any locale='[runtime expression]'])
I return all failure messages as an array of strings.

Parameters:
locale

getFailureMessagesByField

public struct getFailureMessagesByField([Any limit=''], [string delimiter=''], [Any locale='[runtime expression]'])
Returns a structure containing a list of failure messages for each clientFieldName.

Parameters:
limit - The maximum number of messages to return per field
delimiter - A delimeter to use to separate messages per field. Blank creates an array instead of a string.
locale

getFailureMessagesByProperty

public struct getFailureMessagesByProperty([Any limit=''], [string delimiter=''], [Any locale='[runtime expression]'])
Returns a structure containing a list of failure messages for each propertyName.

Parameters:
limit - The maximum number of messages to return per property
delimiter - A delimeter to use to separate messages per property. Blank creates an array instead of a string.
locale

getFailures

public any getFailures([Any locale='[runtime expression]'])
returns all failures as an array of structs

Parameters:
locale - the locale to use to translate the failure messages

getFailuresAsString

public any getFailuresAsString([string delim='
'], [Any locale='[runtime expression]'])
I return the errors as a string separated with a specified delimiter.

Parameters:
delim - The delimiter to use to separate messages
locale

getFailuresAsStruct

public any getFailuresAsStruct([Any locale='[runtime expression]'])
Deprecated. Use getFailuresByProperty() or getFailuresByField().

Parameters:
locale

getFailuresAsValidationErrorCollection

public any getFailuresAsValidationErrorCollection([Any locale='[runtime expression]'])
I return failures in a format expected from a ModelGlue.util.ValidationErrorCollection

Parameters:
locale

getFailuresByField

public struct getFailuresByField([Any limit=''], [Any locale='[runtime expression]'])
Returns a structure containing an array of failures for each clientFieldName.

Parameters:
limit - The maximum number of failures to return per field
locale

getFailuresByFieldOrProperty

private struct getFailuresByFieldOrProperty(Any keyType, boolean messageOnly, [Any limit=''], [string delimiter=''], [Any locale='[runtime expression]'])
Returns a structure containing an array of failures for each propertyName.

Parameters:
keyType - Should be either ClientFieldName or PropertyName
messageOnly - Should only the failure messages be returned, or the complete failure struct?
limit - The maximum number of failures to return per field or property
delimiter - A delimeter to use to separate messages per property. Blank creates an array instead of a string.
locale

getFailuresByProperty

public struct getFailuresByProperty([Any limit=''], [Any locale='[runtime expression]'])
Returns a structure containing an array of failures for each propertyName.

Parameters:
limit - The maximum number of failures to return per property
locale

getFailuresForUniForm

public any getFailuresForUniForm([Any locale='[runtime expression]'])
Returns a structure of failures in a format the cfUniform likes

Parameters:
locale

getIsSuccess

public boolean getIsSuccess()


getMemento

public any getMemento()


getRawFailures

public any getRawFailures()
returns the internal array of failure structs


getSuccessMessage

public any getSuccessMessage()


getTheObject

public any getTheObject()


logCriteriaOutcome

public void logCriteriaOutcome(string classname, string context, any criteria, string passed)
I log the outcome when a rule/condition is evaluated

Parameters:
classname
context
criteria
passed

onMissingMethod

public any onMissingMethod(string MissingMethodName, struct MissingMethodArguments)
provides for generic getter/setter.

Parameters:
MissingMethodName
MissingMethodArguments

setIsSuccess

public void setIsSuccess(boolean IsSuccess)

Parameters:
IsSuccess

setSuccessMessage

public void setSuccessMessage(any SuccessMessage)

Parameters:
SuccessMessage

setTheObject

public void setTheObject(any theObject)

Parameters:
theObject

ValidateThis API Documentation