public function addValidator($validator, $message = null)
    {
        try {
            $msg = $message;
            if (is_array($message)) {
                $msg = array_shift($message);
                $this->context = $message;
            }
            $validator = StaticValidator::create($validator, $msg);
            $this->getValidationChain()
                ->add($validator);
            if ($validator instanceof NotEmpty) {
                $this->setRequired(true);
            }
        } catch (ValidatorException $caught) {
            throw new InvalidArgumentException(
                $caught->getMessage(),
                0,
                $caught
            );
        }
        return $this;
    }