beforeValidationOnCreate dont work ?

I have a code like this:

public function beforeValidationOnCreate()
    {
        if(empty($this->value)){
            $this->value=false;
        }
    }

but it doesn't work, it says that value is required

Does it still fail if you set $this->value to a valid value?