public function process()
    {
        parent::process();

        // if nothing was submitted by the user, shortcut return
        if (!$this->hasRawValue()) {
            $this->value = null;
            return;
        }

        $this->value = $this->getRawValue();

        if ($this->auto_trim) {
            $this->value = trim($this->value);
            if ($this->value === '') {
                $this->value = null;
            }
        }

        $len = $this->value === null ? 0 : mb_strlen($this->value);

        if (!$this->required && $this->value === null) {
            return;
        } elseif ($this->value === null) {
            $this->addMessage($this->getValidationMessage('required'));
        } elseif ($this->maxlength !== null && $len > $this->maxlength) {
            $message = $this->getValidationMessage('too-long');
            $message->primary_content = sprintf(
                $message->primary_content,
                $this->maxlength
            );

            $this->addMessage($message);
        } elseif ($this->minlength !== null && $len < $this->minlength) {
            $message = $this->getValidationMessage('too-short');
            $message->primary_content = sprintf(
                $message->primary_content,
                $this->minlength
            );

            $this->addMessage($message);
        }
    }