|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.validation.ValidationManager
public class ValidationManager
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 |
void |
SETRESOURCEBUNDLE(any resourceBundle)
set: A resource bundle plugin for i18n capabilities |
void |
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, string 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 |
---|
|
Constructor Detail |
---|
public init([struct sharedConstraints='[runtime expression]'])
sharedConstraints
- A structure of shared constraintsMethod Detail |
---|
public any GETRESOURCEBUNDLE()
public any GETWIREBOX()
public void SETRESOURCEBUNDLE(any resourceBundle)
resourceBundle
public void SETWIREBOX(any wirebox)
wirebox
public IValidationManager addSharedConstraint(string name, struct constraint)
addSharedConstraint
in interface
IValidationManager
name
- Filter by name or notconstraint
- The constraint to store.private struct determineConstraintsDefinition(any target, [any constraints=''])
target
constraints
private struct discoverConstraints(any target)
target
public struct getSharedConstraints([string name])
getSharedConstraints
in interface
IValidationManager
name
- Filter by name or notpublic IValidator getValidator(string validatorType, string validationData)
validatorType
validationData
public ValidationManager processRules(IValidationResult results, struct rules, any target, any field)
results
rules
target
field
public IValidationManager setSharedConstraints([struct constraints])
setSharedConstraints
in interface
IValidationManager
constraints
- Filter by name or notpublic boolean sharedConstraintsExists(string name)
sharedConstraintsExists
in interface
IValidationManager
name
- The shared constraint to checkpublic coldbox.system.validation.IValidationResult validate(any target, [string fields='*'], [any constraints=''], [string locale=''], [string excludeFields=''])
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.
|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |