Packageorg.granite.validation.constraints
Classpublic class NotNull
InheritanceNotNull Inheritance BaseConstraint

The ActionsScript3 implementation of the javax.validation.constraints.NotNull annotation validator.

The annotated element must not be null.

Accepted arguments are:

Accepts any type.

Example:

  [NotNull(message="{my.custom.message}", groups="path.to.MyGroup1, path.to.MyGroup2")]
  public function get property():Object {
      ...
  }
General notes on escaping:



Public Properties
 PropertyDefined by
 Inheritedfactory : ValidatorFactory
The ValidatorFactory passed to the initialized function.
BaseConstraint
 Inheritedgroups : Array
The processing groups with which this constraint is associated as an array of Class.
BaseConstraint
 Inheritedmessage : String
The error message associated with this constraint.
BaseConstraint
 Inheritedpayload : Array
The payload with which this constraint is associated as an array of String.
BaseConstraint
 Inheritedproperties : Array
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).
BaseConstraint
Protected Properties
 PropertyDefined by
 Inherited_factory : ValidatorFactory
Direct access (protected) to the ValidatorFactory instance passed to the initialized function.
BaseConstraint
 Inherited_groups : Array
Direct access (protected) to the groups defined for this constraint.
BaseConstraint
 Inherited_message : String
Direct access (protected) to the message key defined for this constraint.
BaseConstraint
 Inherited_payload : Array
Direct access (protected) to the payload defined for this constraint.
BaseConstraint
 Inherited_properties : Array
Direct access (protected) to the properties defined for this constraint.
BaseConstraint
Public Methods
 MethodDefined by
  
initialize(annotation:Annotation, factory:ValidatorFactory):void
Initialize this constraint, according to the supplied annotation parameters.
NotNull
  
validate(value:*):String
Validate the value parameter, according to this constraint specification.
NotNull
Protected Methods
 MethodDefined by
 Inherited
[static] Creates a definition of the standard message annotation argument with the supplied string.
BaseConstraint
 Inherited
internalInitialize(factory:ValidatorFactory, annotation:Annotation, defaultMessage:String, parameterDefinitions:Array = null):Dictionary
Parse constraint parameters according to the annotation arguments, initialize the message, groups and payload properties and return a Dictionary that contains all parsed values.
BaseConstraint
Public Constants
 ConstantDefined by
  DEFAULT_MESSAGE : String = "{javax.validation.constraints.NotNull.message}"
[static] The default message key of this constraint.
NotNull
Protected Constants
 ConstantDefined by
 InheritedBOOLEAN_TYPES : Array
[static] An array of boolean types: [Boolean] (used when checking the value type of a constraint annotation argument).
BaseConstraint
 InheritedDATE_TYPES : Array
[static] An array of date types: [Date] (used when checking the value type of a constraint annotation argument).
BaseConstraint
 InheritedGROUPS_PARAMETER : ParameterDefinition
[static] The definition of the standard groups constraint annotation argument, as an optional array of Class names.
BaseConstraint
 InheritedNUMBER_STRING_TYPES : Array
[static] An array of numeric or string types: [BigDecimal, BigInteger, Long, Number, int, uint String] (used when checking the value type of a constraint annotation argument).
BaseConstraint
 InheritedPAYLOAD_PARAMETER : ParameterDefinition
[static] The definition of the standard payload constraint annotation argument, as an optional array of Strings.
BaseConstraint
 InheritedPROPERTIES_PARAMETER : ParameterDefinition
[static] The definition of the standard properties constraint annotation argument, as an optional array of Strings.
BaseConstraint
 InheritedSTRING_TYPES : Array
[static] An array of string types: [String] (used when checking the value type of a constraint annotation argument).
BaseConstraint
Method detail
initialize()method
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
annotation:Annotation — the anntotation defining this constraint.
 
factory:ValidatorFactory
validate()method 
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
Stringnull if the supplied value is valid, an error message key otherwise.
Constant detail
DEFAULT_MESSAGEconstant
public static const DEFAULT_MESSAGE:String = "{javax.validation.constraints.NotNull.message}"

The default message key of this constraint.