|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.validation.result.ValidationResult
public class ValidationResult
Constructor Summary | |
---|---|
init([string locale=''], [string targetName=''], [any resourceBundle=''], [struct constraints='[runtime expression]'])
|
Method Summary | |
---|---|
struct |
GETCONSTRAINTS()
get: The constraints evaluated in the validation process |
array |
GETERRORS()
get: A collection of error objects represented in this result object |
string |
GETLOCALE()
get: The locale this result validation is using |
any |
GETRESOURCEBUNDLE()
get: The resource bundle object |
void |
SETCONSTRAINTS(struct constraints)
set: The constraints evaluated in the validation process |
void |
SETERRORS(array errors)
set: A collection of error objects represented in this result object |
void |
SETRESOURCEBUNDLE(any resourceBundle)
set: The resource bundle object |
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) |
string |
getAllErrorsAsJSON([string field])
Get all errors or by field as a JSON structure |
struct |
getAllErrorsAsStruct([string field])
Get all errors as flat structure that can easily be used for UI display |
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 |
private void |
globalReplacements(any message, any error)
|
boolean |
hasErrors([string field])
Determine if the results had error or not |
boolean |
hasLocale()
has locale information |
IValidationError |
newError([struct properties])
Get a new error object |
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.component |
---|
|
Constructor Detail |
---|
public init([string locale=''], [string targetName=''], [any resourceBundle=''], [struct constraints='[runtime expression]'])
locale
targetName
resourceBundle
constraints
Method Detail |
---|
public struct GETCONSTRAINTS()
public array GETERRORS()
public string GETLOCALE()
public any GETRESOURCEBUNDLE()
public void SETCONSTRAINTS(struct constraints)
constraints
public void SETERRORS(array errors)
errors
public void SETRESOURCEBUNDLE(any resourceBundle)
resourceBundle
public IValidationResult addError(IValidationError error)
addError
in interface
IValidationResult
error
- The validation error to add into the results objectpublic IValidationResult clearErrors()
clearErrors
in interface
IValidationResult
public array getAllErrors([string field])
getAllErrors
in interface
IValidationResult
field
- The field to use to filter the error messages on (optional)public string getAllErrorsAsJSON([string field])
field
public struct getAllErrorsAsStruct([string field])
field
public numeric getErrorCount([string field])
getErrorCount
in interface
IValidationResult
field
- The field to count on (optional)public coldbox.system.validation.result.IValidationError[] getFieldErrors(string field)
getFieldErrors
in interface
IValidationResult
field
- The field to return error objects onpublic struct getResultMetadata()
getResultMetadata
in interface
IValidationResult
public string getTargetName()
getTargetName
in interface
IValidationResult
public string getValidationLocale()
getValidationLocale
in interface
IValidationResult
private void globalReplacements(any message, any error)
message
error
public boolean hasErrors([string field])
hasErrors
in interface
IValidationResult
field
- The field to count on (optional)public boolean hasLocale()
hasLocale
in interface
IValidationResult
public IValidationError newError([struct properties])
properties
public IValidationResult setLocale(string locale)
setLocale
in interface
IValidationResult
locale
public IValidationResult setResultMetadata(struct data)
setResultMetadata
in interface
IValidationResult
data
public IValidationResult setTargetName(string name)
setTargetName
in interface
IValidationResult
name
|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |