| Package | org.granite.validation |
| Interface | public interface IConstraint |
| Implementors | BaseConstraint |
| Property | Defined by | ||
|---|---|---|---|
| factory : ValidatorFactory
[read-only]
The
ValidatorFactory passed to the initialized
function. | IConstraint | ||
| groups : Array [read-only]
The processing groups with which this constraint is associated as
an array of
Class. | IConstraint | ||
| message : String [read-only]
The error message associated with this constraint.
| IConstraint | ||
| payload : Array [read-only]
The payload with which this constraint is associated as
an array of
String. | IConstraint | ||
| properties : Array [read-only]
The properties with which this constraint is associated as
an array of
String (only for class-level constraints that
deal with one or more properties, in order to figure out where error
messages should be displayed when this constraint fails). | IConstraint | ||
| Method | Defined by | ||
|---|---|---|---|
|
Initialize this constraint, according to the supplied annotation
parameters.
| IConstraint | ||
|
validate(value:*):String
Validate the
value parameter, according to this
constraint specification. | IConstraint | ||
| factory | property |
factory:ValidatorFactory [read-only]
The ValidatorFactory passed to the initialized
function.
public function get factory():ValidatorFactory
| groups | property |
groups:Array [read-only]
The processing groups with which this constraint is associated as
an array of Class.
public function get groups():Array
| message | property |
message:String [read-only]The error message associated with this constraint.
Implementation public function get message():String
| payload | property |
payload:Array [read-only]
The payload with which this constraint is associated as
an array of String.
public function get payload():Array
| properties | property |
properties:Array [read-only]
The properties with which this constraint is associated as
an array of String (only for class-level constraints that
deal with one or more properties, in order to figure out where error
messages should be displayed when this constraint fails).
public function get properties():Array
| initialize | () | method |
public function initialize(annotation:Annotation, factory:ValidatorFactory):void
Initialize this constraint, according to the supplied annotation
parameters.
The org.granite.validation.BaseConstraint
implementation of this method throws an Error
and must be overridden in inherited classes.
annotation:Annotation — the anntotation defining this constraint.
|
|
factory:ValidatorFactory |
ConstraintDefinitionError — if a required
argument is missing, if an argument value isn't of the expected
type or if an unknown argument is present.
|
See also
| validate | () | method |
public function validate(value:*):String
Validate the value parameter, according to this
constraint specification.
The org.granite.validation.BaseConstraint
implementation of this method throws an Error
and must be overridden in inherited classes.
value:* — the value to be validated.
|
String — null if the supplied value is valid, an error
message key otherwise.
|
ConstraintExecutionError — if the
value parameter is an instance of an unsupported
type according to this constraint specification.
|
See also