Class fever.data.validators.ArgumentsValidator

Description

Validates arguments Array ( length of array and check for undefined reference ).

Example

 public function ValidationTest6()
 {
 	_valideArguments( 800 );
 }
 
 private function _valideArguments( width : Number, param : Number ) :Void
 {
 	var validator : ArgumentsValidator = new ArgumentsValidator();
 	validator.minValue = 2;
 	validator.allowUndefined = false;
 	
 	var result : ValidationResultEvent = validator.validate( arguments );
 	if(result.type == ValidationResultEvent.INVALID)
 	{
		Logger.LOG( result.message, LogLevel.WARN, FeverDebug.channel );	
 		//output : 'The length of arguments is too small'.
 	}
 	else
 	{
 		Logger.LOG( "Nice !", LogLevel.WARN, FeverDebug.channel );
 	}
 }
 

See Also

Field Index

allowUndefined, maxValue, minValue

Inherited from Validator

Method Index

new ArgumentsValidator()

Inherited from Validator

Constructor Detail

ArgumentsValidator

public function ArgumentsValidator()

Constructor.

Field Detail

maxValue

public maxValue:Number
Maximum waiting arguments. ( default IsNan )

minValue

public minValue:Number
Minimum waiting arguments. ( default IsNan )

allowUndefined

public allowUndefined:Boolean
Indicates if undefined arguments are checked. ( default true )