coldbox.system.validation.result

Interface IValidationResult

WEB-INF.cftags.interface
        extended by coldbox.system.validation.result.IValidationResult
Class Attributes:
None
All Known Implementing Classes:
ValidationResult
Method Summary
IValidationResult addError(IValidationError error)
     Add errors into the result object.
IValidationResult clearErrors()
     Clear All errors.
array getAllErrors([string field])
     Get the Errors Array, which is an array of error messages (strings).
numeric getErrorCount([string field])
     Get how many errors you have.
coldbox.system.validation.result.IValidationError[] getFieldErrors(string field)
     Get an error object for a specific field that failed.
struct getResultMetadata()
     Get a collection of metadata about the validation results.
string getTargetName()
     Get the name of the target object that got validated.
string getValidationLocale()
     Get the validation locale.
boolean hasErrors([string field])
     Determine if the results had error or not.
boolean hasLocale()
     has locale information.
IValidationResult setLocale(string locale)
     Set the validation locale.
IValidationResult setResultMetadata(struct data)
     Set a collection of metadata into the results object.
IValidationResult setTargetName(string name)
     Set the validation target object name.
 
Methods inherited from class WEB-INF.cftags.interface
None

Method Detail

addError

public IValidationResult addError(IValidationError error)

Add errors into the result object

Parameters:
error - The validation error to add into the results object

clearErrors

public IValidationResult clearErrors()

Clear All errors


getAllErrors

public array getAllErrors([string field])

Get the Errors Array, which is an array of error messages (strings)

Parameters:
field - The field to use to filter the error messages on (optional)

getErrorCount

public numeric getErrorCount([string field])

Get how many errors you have

Parameters:
field - The field to count on (optional)

getFieldErrors

public coldbox.system.validation.result.IValidationError[] getFieldErrors(string field)

Get an error object for a specific field that failed. Throws exception if the field does not exist

Parameters:
field - The field to return error objects on

getResultMetadata

public struct getResultMetadata()

Get a collection of metadata about the validation results


getTargetName

public string getTargetName()

Get the name of the target object that got validated


getValidationLocale

public string getValidationLocale()

Get the validation locale


hasErrors

public boolean hasErrors([string field])

Determine if the results had error or not

Parameters:
field - The field to count on (optional)

hasLocale

public boolean hasLocale()

has locale information


setLocale

public IValidationResult setLocale(string locale)

Set the validation locale

Parameters:
locale

setResultMetadata

public IValidationResult setResultMetadata(struct data)

Set a collection of metadata into the results object

Parameters:
data

setTargetName

public IValidationResult setTargetName(string name)

Set the validation target object name

Parameters:
name