/**
  * Set the format of the text entered by the candidate.
  * 
  * @param integer $format A value from the TextFormat enumeration.
  * @throws InvalidArgumentException If $format is not a value from the TextFormat enumeration.
  */
 public function setFormat($format)
 {
     if (in_array($format, TextFormat::asArray()) === true) {
         $this->format = $format;
     } else {
         $msg = "The 'format' argument must be a value from the TextFormat enumeration, '" . gettype($format) . "' given.";
         throw new InvalidArgumentException($msg);
     }
 }