WEB-INF.cftags.component coldbox.system.validation.result.ValidationResult
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
struct
|
constraints
The constraints evaluated in the validation process. |
true
|
false
|
|
array
|
errors
A collection of error objects represented in this result object. |
true
|
false
|
|
string
|
locale
The locale this result validation is using. |
true
|
false
|
|
any
|
resourceBundle
The resource bundle object. |
true
|
false
|
|
struct
|
resultMetadata
Extra metadata you can store in the results object. |
true
|
false
|
|
string
|
targetName
The name of the target object. |
true
|
false
|
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. |
ValidationResult
|
SETCONSTRAINTS(struct constraints)
set: The constraints evaluated in the validation process. |
ValidationResult
|
SETERRORS(array errors)
set: A collection of error objects represented in this result object. |
ValidationResult
|
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 |
---|
None |
Constructor Detail |
---|
locale
targetName
resourceBundle
constraints
Property Detail |
---|
The constraints evaluated in the validation process
serializable
- truerequired
- falseA collection of error objects represented in this result object
serializable
- truerequired
- falseThe locale this result validation is using
serializable
- truerequired
- falseThe resource bundle object
serializable
- truerequired
- falseExtra metadata you can store in the results object
serializable
- truerequired
- falseThe name of the target object
serializable
- truerequired
- falseMethod Detail |
---|
get: The constraints evaluated in the validation process
get: A collection of error objects represented in this result object
get: The locale this result validation is using
get: The resource bundle object
set: The constraints evaluated in the validation process
constraints
set: A collection of error objects represented in this result object
errors
set: The resource bundle object
resourceBundle
Add errors into the result object
addError
in interface
IValidationResult
error
- The validation error to add into the results objectClear All errors
clearErrors
in interface
IValidationResult
Get the Errors Array, which is an array of error messages (strings)
getAllErrors
in interface
IValidationResult
field
- The field to use to filter the error messages on (optional)Get all errors or by field as a JSON structure
field
Get all errors as flat structure that can easily be used for UI display
field
Get how many errors you have
getErrorCount
in interface
IValidationResult
field
- The field to count on (optional)Get an error object for a specific field that failed. Throws exception if the field does not exist
getFieldErrors
in interface
IValidationResult
field
- The field to return error objects onGet a collection of metadata about the validation results
getResultMetadata
in interface
IValidationResult
Get the name of the target object that got validated
getTargetName
in interface
IValidationResult
Get the validation locale
getValidationLocale
in interface
IValidationResult
message
error
Determine if the results had error or not
hasErrors
in interface
IValidationResult
field
- The field to count on (optional)has locale information
hasLocale
in interface
IValidationResult
Get a new error object
properties
Set the validation locale
setLocale
in interface
IValidationResult
locale
Set a collection of metadata into the results object
setResultMetadata
in interface
IValidationResult
data
Set the validation target object name
setTargetName
in interface
IValidationResult
name