The ActionsScript3 implementation of the
javax.validation.constraints.AssertFalse annotation
validator.
The annotated element must be false.
Accepted arguments are:
- message (optional): used to create the error message (override the
default message).
- groups (optional): a comma separated list of fully qualified interface names that
specifies the processing groups with which the constraint declaration is associated.
- payload (optional): a comma separated list of
String that specifies the
payloads with which the constraint declaration is associated (unlike the Java
implementation, payloads are arbitrary Strings and does not represent
necessarily existing class names).
Supported types are:
null elements are considered valid.
Example:
[AssertFalse(message="{my.custom.message}", groups="path.to.MyGroup1, path.to.MyGroup2")]
public function get property():Boolean {
...
}
General notes on escaping:
- Double quotes: all double quotes (
") in argument values must be escaped
by using the XML entity (").
- Ampersand: all ampersands (
&) in argument values should be escaped by
using the XML entity (&).
- Less and greater than: all "less than" (
<) characters in argument values
must be escaped by using the XML entity (<). All "greater than"
(>) characters in argument values should be escaped by using the XML entity
(>)
- White spaces: since all argument values are trimed, you may use the pseudo XML entity
(
&space;) in order to keep leading or trailing white spaces in literals.
- Comma: arguments specified as comma separated String lists (such as
groups)
may use the pseudo XML entity (,) in order to keep comma characters
in literals.
public override 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.
Parameters
public override 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.
Parameters
| value:* — the value to be validated.
|
Returns
| String — null if the supplied value is valid, an error
message key otherwise.
|
public static const DEFAULT_MESSAGE:String = "{javax.validation.constraints.AssertFalse.message}"
The default message key of this constraint.