WEB-INF.cftags.component coldbox.system.validation.ValidationManager
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
resourceBundle
A resource bundle plugin for i18n capabilities.
|
true
|
false
|
|
struct
|
sharedConstraints
Shared constraints that can be loaded into the validation manager. |
true
|
false
|
|
any
|
wirebox
WireBox Object Factory.
|
true
|
false
|
Constructor Summary | |
---|---|
init([struct sharedConstraints='[runtime expression]'])
Constructor. |
Method Summary | |
---|---|
any
|
GETRESOURCEBUNDLE()
get: A resource bundle plugin for i18n capabilities. |
any
|
GETWIREBOX()
get: WireBox Object Factory. |
ValidationManager
|
SETRESOURCEBUNDLE(any resourceBundle)
set: A resource bundle plugin for i18n capabilities. |
ValidationManager
|
SETWIREBOX(any wirebox)
set: WireBox Object Factory. |
IValidationManager
|
addSharedConstraint(string name, struct constraint)
Store a shared constraint. |
private struct
|
determineConstraintsDefinition(any target, [any constraints=''])
Determine from where to take the constraints from. |
private struct
|
discoverConstraints(any target)
Get the constraints structure from target objects, if none, it returns an empty structure. |
struct
|
getSharedConstraints([string name])
Retrieve the shared constraints, all of them or by name. |
IValidator
|
getValidator(string validatorType, any validationData)
Create validators according to types and validation data. |
ValidationManager
|
processRules(IValidationResult results, struct rules, any target, any field)
Process validation rules on a target object and field. |
IValidationManager
|
setSharedConstraints([struct constraints])
Set the entire shared constraints structure. |
boolean
|
sharedConstraintsExists(string name)
Check if a shared constraint exists by name. |
coldbox.system.validation.IValidationResult
|
validate(any target, [string fields='*'], [any constraints=''], [string locale=''], [string excludeFields=''])
Validate an object. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
Constructor
sharedConstraints
- A structure of shared constraintsProperty Detail |
---|
A resource bundle plugin for i18n capabilities
inject
- coldbox:plugin:ResourceBundlerequired
- falseserializable
- trueShared constraints that can be loaded into the validation manager
serializable
- truerequired
- falseWireBox Object Factory
inject
- wireboxrequired
- falseserializable
- trueMethod Detail |
---|
get: A resource bundle plugin for i18n capabilities
get: WireBox Object Factory
set: A resource bundle plugin for i18n capabilities
resourceBundle
set: WireBox Object Factory
wirebox
Store a shared constraint
addSharedConstraint
in interface
IValidationManager
name
- Filter by name or notconstraint
- The constraint to store.Determine from where to take the constraints from
target
constraints
Get the constraints structure from target objects, if none, it returns an empty structure
target
Retrieve the shared constraints, all of them or by name
getSharedConstraints
in interface
IValidationManager
name
- Filter by name or notCreate validators according to types and validation data
validatorType
validationData
Process validation rules on a target object and field
results
rules
target
field
Set the entire shared constraints structure
setSharedConstraints
in interface
IValidationManager
constraints
- Filter by name or notCheck if a shared constraint exists by name
sharedConstraintsExists
in interface
IValidationManager
name
- The shared constraint to checkValidate an object
validate
in interface
IValidationManager
target
- The target object to validate or a structure like a form or collection. If it is a collection, we will build a generic object for you so we can validate the structure of name-value pairs.fields
- One or more fields to validate on, by default it validates all fields in the constraints. This can be a simple list or an array.constraints
- An optional shared constraints name or an actual structure of constraints to validate on.locale
- An optional locale to use for i18n messagesexcludeFields
- An optional list of fields to exclude from the validation.