Set the validator before the validate action is called.
763374
protected function _beforeControllerValidate()
    {
        if (!isset($this->_validator)) {
            $this->setValidator($this->_mixer->getIdentifier()->name);
        }
    }
608132
protected function beforeValidate() 
	{
		$controller = strtolower(Yii::app()->controller->id);
		$action = strtolower(Yii::app()->controller->action->id);
		$currentAction = strtolower(Yii::app()->controller->id.'/'.Yii::app()->controller->action->id);

		if(parent::beforeValidate()) {
			if($currentAction == 'settings/general') {
				if($this->online != 1) {
					if($this->construction_date == '')
						$this->addError('construction_date', Yii::t('phrase', 'Maintenance date cannot be blank.'));
					if($this->online == 0 && $this->construction_text['maintenance'] == '')
						$this->addError('construction_text[maintenance]', Yii::t('phrase', 'Maintenance text cannot be blank.'));
					if($this->online == 2 && $this->construction_text['comingsoon'] == '')
						$this->addError('construction_text[comingsoon]', Yii::t('phrase', 'Coming Soon text cannot be blank.'));
				}

				if($this->event_i == 0) {
					$this->event_startdate = '00-00-0000';
					$this->event_finishdate = '00-00-0000';
					
				} else {
					$condition = 0;
					if($this->event_startdate != '' && in_array(date('Y-m-d', strtotime($this->event_startdate)), array('0000-00-00','1970-01-01','0002-12-02','-0001-11-30'))) {
						$condition = 0;
						$this->addError('event_startdate', Yii::t('phrase', 'Event Startdate cannot be blank or default date.'));
					} else
						$condition = 1;
					if($this->event_finishdate != '' && in_array(date('Y-m-d', strtotime($this->event_finishdate)), array('0000-00-00','1970-01-01','0002-12-02','-0001-11-30'))) {
						$condition = 0;
						$this->addError('event_finishdate', Yii::t('phrase', 'Event Finishdate cannot be blank or default date.'));
					} else
						$condition = 1;
					if($condition == 1 && (date('Y-m-d', strtotime($this->event_startdate)) >= date('Y-m-d', strtotime($this->event_finishdate))))
						$this->addError('event_finishdate', Yii::t('phrase', 'Event Finishdate tidak boleh lebih kecil'));
				}
			}
			
			$this->modified_id = !Yii::app()->user->isGuest ? Yii::app()->user->id : null;
		}
		return true;
	}
445761
public final void setValidator(@NonNull final Validator<Type> validator) {
        Condition.INSTANCE.ensureNotNull(validator, "The validator may not be null");
        this.validator = validator;
    }
1312693
public void removeValidator(Validator validator)
    {
        if (validator == null || _validatorList == null)
        {
            return;
        }

        _validatorList.remove(validator);
    }
1158687
public function setValidator(Validator $validator)
    {
        $this->validator = $validator;
        
        $validator->configureRule($this);
        
        return $this;
    }
874250
@SuppressWarnings("unchecked")
    protected void validate() {

        if (m_ou == null) {
            m_name.removeAllValidators();
            m_name.addValidator(new NameValidator());
        }
        m_description.setRequired(true);
        m_description.setRequiredError("Required");

        if (m_ouResources.getRows().isEmpty() & !m_webuser.getValue().booleanValue()) {
            CmsPathSelectField field = new CmsPathSelectField();
            field.setUseRootPaths(true);
            field.setCmsObject(m_cms);
            m_ouResources.addRow(field);
        }
        for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
            ((AbstractField<String>)row.getComponent()).removeAllValidators();
            ((AbstractField<String>)row.getComponent()).addValidator(new ResourceValidator());
        }
    }
617452
def validate(self):
        """"""
        if self.error:
            return False

        for v in self.validators:
            self.error = v(self.value)
            if self.error:
                return False

        return True
764414
public AssertSoapFaultBuilder validator(String validatorName, ApplicationContext applicationContext) {
        action.setValidator(applicationContext.getBean(validatorName, SoapFaultValidator.class));
        return this;
    }
586823
protected function validate()
    {
        $args = $this->dispatcher->getParam('args');
        if (isset($this->actions[$this->actionName])) {
            $action = $this->actions[$this->actionName];
            $action->validate($args);
        }
    }
1358661
public void validate(final Runnable nextAction) {

        validateFull(m_structureId, getAliasPaths(), new AsyncCallback<Map<String, String>>() {

            public void onFailure(Throwable caught) {

                // do nothing

            }

            public void onSuccess(Map<String, String> result) {

                for (Map.Entry<String, String> entry : result.entrySet()) {
                    if (entry.getValue() != null) {
                        m_hasValidationErrors = true;
                    }
                }
                m_defaultValidationHandler.onSuccess(result);
                nextAction.run();
            }
        });
    }
1124906
protected function beforeValidate() 
	{
		if(parent::beforeValidate()) {
			if($this->isNewRecord) {
				if($this->default == 1)
					$this->actived = 1;
				$this->creation_id = !Yii::app()->user->isGuest ? Yii::app()->user->id : null;
			} else
				$this->modified_id = !Yii::app()->user->isGuest ? Yii::app()->user->id : null;
		}
		return true;
	}
276326
function setValidateLabel () {
  var values = getCheckedAndUnchecked(form.validate.schema, form.validate.spec);

  switch (values.checked.length) {
    case 0:
      form.validate.label.text("Don't validate anything");
      break;
    case 1:
      form.validate.label.text("Don't validate Swagger " + values.unchecked[0]);
      break;
    case 2:
      form.validate.label.text("Validate everything");
  }
}
608487
protected function before_validate() {
        $this->beforeupdate = null;

        // During update.
        if ($this->get('id')) {
            $this->beforeupdate = new competency_framework($this->get('id'));
        }

    }
431839
def pre_validate(self, form):
        ''''''
        for preprocessor in self._preprocessors:
            preprocessor(form, self)
        super(FieldHelper, self).pre_validate(form)
857593
public function beforeValidationOnCreate()
    {
        // Timestamp the confirmaton
        $this->createdAt = time();

        // Generate a random confirmation code
        $this->code = preg_replace('/[^a-zA-Z0-9]/', '', base64_encode(openssl_random_pseudo_bytes(24)));

        // Set status to non-confirmed
        $this->reset = 'N';
    }
1183427
public function beforeValidate()
    {
        if (!$theme = Theme::getEditTheme()) {
            throw new ApplicationException('Unable to find the active theme.');
        }

        $themeMap = $this->getSettingsValue('theme_map', []);
        $themeMap[$theme->getDirName()] = $this->getSettingsValue('cms_page');
        $this->setSettingsValue('theme_map', $themeMap);
    }
1120160
public void addValidator(Validator validator) {

        if (validator == null) {
            throw new NullPointerException();
        }

        if (validators == null) {
            validators = new AttachedObjectListHolder<Validator>();
        }
        validators.add(validator);

    }