/**
  * {@inheritdoc}
  **/
 public function validate($value, Constraint $constraint)
 {
     $this->regexValidator->initialize($this->context);
     $this->regexValidator->validate($value, $constraint);
     $notBlankConstraint = new NotBlank();
     $notBlankConstraint->message = $constraint->message;
     $this->notBlankValidator->initialize($this->context);
     $this->notBlankValidator->validate($value, $notBlankConstraint);
 }
 protected function setPropertyPath($propertyPath)
 {
     $this->propertyPath = $propertyPath;
     switch ($this->getApiVersion()) {
         case Validation::API_VERSION_2_4:
             $this->context = $this->createContext();
             $this->validator->initialize($this->context);
             break;
         case Validation::API_VERSION_2_5:
         case Validation::API_VERSION_2_5_BC:
             $this->context->setNode($this->value, $this->object, $this->metadata, $this->propertyPath);
             break;
     }
 }
 protected function setPropertyPath($propertyPath)
 {
     $this->propertyPath = $propertyPath;
     $this->context = $this->createContext();
     $this->validator->initialize($this->context);
 }
 protected function setRoot($root)
 {
     $this->root = $root;
     $this->context = $this->createContext();
     $this->validator->initialize($this->context);
 }