{@inheritDoc}

@throws ConfigValidationException
350238
@Override
    public InputStream validateResource(InputStream configDocInputStream, String docLocation) throws ConfigValidationException {

        errorMsgIssued = false;
        InputStream returnInputStream = null;

        try {
            // Reads the input stream into an output stream where we can copy it
            byte[] bfr = new byte[4096];
            int len = 0;
            ByteArrayOutputStream bfrOutputStream = new ByteArrayOutputStream();
            while ((len = configDocInputStream.read(bfr, 0, bfr.length)) > -1)
                bfrOutputStream.write(bfr, 0, len);
            configDocInputStream.close();
            bfrOutputStream.close();

            // Makes two copies of the input stream (one for us and one for the
            // the configuration document parser)
            InputStream validatorInputStream =
                            new ByteArrayInputStream(bfrOutputStream.toByteArray());
            returnInputStream = new ByteArrayInputStream(bfrOutputStream.toByteArray());

            // Parses the document to be verified
            Document document = dbFactory.newDocumentBuilder().parse(validatorInputStream);

            // Verifies the signature
            verifyDocument(document, docLocation);
        }

        // An error occurred while attempting to verify the document signature
        catch (Throwable t) {
            if (!errorMsgIssued) {
                if (t instanceof SAXException)
                    printErrorMessage("error.configValidator.parseFailed",
                                      docLocation, t.getMessage());
                else if (t instanceof MarshalException)
                    printErrorMessage("error.configValidator.unmarshalFailed",
                                      docLocation, t.getMessage());
                else
                    printErrorMessage("error.configValidator.error",
                                      docLocation, t.getMessage());
            }

            FFDCFilter.processException(t, CLASS_NAME, "138", this, new Object[] { docLocation });

            returnInputStream = null;

            // Throw exception to terminate the server
            throw new ConfigValidationException("Configuration parsing encountered an invalid document", docLocation);
        }

        return returnInputStream;
    }
569361
private function validateMessageType()
    {
        if (!in_array($this->config[self::CONFIG_TYPE], self::VALID_TYPES, true)) {
            throw new Exception(self::ERR_INVALID_TYPE);
        }

        if ($this->config[self::CONFIG_TYPE] === self::FILE && !$this->config[self::CONFIG_FILE]) {
            throw new Exception(self::ERR_INVALID_FILE);
        }
    }
12701
static public function validateClientConfig(array $config)
    {
        $tags = [static::T8700, static::T8915, static::T8914];

        foreach ($tags as $tag) {
            if (!array_key_exists($tag, $config) || empty($config[$tag])) {
                throw new InvalidArgumentException("Please configure value for tag " . $tag);
            }
        }
    }
826867
@Override
	public void validate() throws HostNameException {
		if(parsedHost != null) {
			return;
		}
		if(validationException != null) {
			throw validationException;
		}
		synchronized(this) {
			if(parsedHost != null) {
				return;
			}
			if(validationException != null) {
				throw validationException;
			}
			try {
				parsedHost = getValidator().validateHost(this);
			} catch(HostNameException e) {
				validationException = e;
				throw e;
			}
		}
	}
555019
public function validate($value)
    {
        try {
            $config = $this->getObject('object.config.factory')->fromString('ini', $value);
        } catch(\RuntimeException $e) {
            $config = null;
        }

        return is_string($value) && !is_null($config);
    }
519768
public function _validate_config($config)
	{
		$validated = array();

		foreach ($config as $name => $item)
		{
			// filter out any driver config
			if (!is_array($item))
			{
				switch ($item)
				{
					case 'cookie_name':
						if ( empty($item) or ! is_string($item))
						{
							$item = 'fuelrid';
						}
					break;

					case 'database':
						// do we have a servers config
						if ( empty($item) or ! is_array($item))
						{
							$item = 'default';
						}
					break;

					default:
					break;
				}

				// global config, was validated in the driver
				$validated[$name] = $item;
			}
		}

		// validate all global settings as well
		return parent::_validate_config($validated);
	}
151246
private function validate(array $config = [])
    {
        $customfields = [];
        foreach ($config as $classname => $customfield) {
            if (!class_exists($classname)) {
                continue;
            }
            array_push($customfields, $customfield);
        }
        return !empty($customfields);
    }
1141524
private function validateRedirections()
    {
        foreach ($this->redirections as $redirection)
        {
            if(!(
                array_key_exists('source', $redirection)
                &&
                array_key_exists('target', $redirection)
                &&
                array_key_exists('type', $redirection)
            ))
            {
                throw new ConfigurationException("Invalid redirection line: " . implode(',', $redirection) . ".");
            }
        }
    }
801360
private final function loadValidation(): void
    {
        $this->validation = new Validation();

        $rules = $this->config->get('validation.rules');
        if ($rules != null) {
            $this->validation->setRules($rules);
        }
    }
15656
@SuppressWarnings("rawtypes")
    @Override
    public void basicValidate(final String section) throws ConfigException {
        ConfigurationUtils.defaultValidate((ConfigurationComponent) this, section);
    }
866542
function validateConfig(config){
    let errors = [];

    if( !config.key ){
        errors.push('Missing config \'config.key\' - Undefined Trello Key');
    }
    if( !config.token ){
        errors.push('Missing config \'config.token\' - Undefined Trello Token');
    }
    return errors;
}
115534
protected function validateConfig()
    {
        $this->queueDriver = $this->createQueueDriver();
        $this->requiredFields = $this->queueDriver->getRequiredConfig();
        $this->config = array_merge($this->queueDriver->getDefaultConfig(), $this->config);
        parent::validateConfig();
    }
1300701
function validate (config) {

	/** Make sure the config object was passed. */
	if (!config) {
		throw new TypeError('Missing configuration object.');
	}

	/** Make sure the panic url is provided. */
	if (typeof config.panic !== 'string') {
		throw new TypeError('Panic server URL "config.panic" not provided.');
	}

	/** Make sure config.clients is an array. */
	if (isArray(config.clients) === false) {
		throw new TypeError('"config.clients" is not an array.');
	}

	var str = JSON.stringify;

	/** Validate the client objects. */
	config.clients.forEach(function (client) {
		if (!client) {
			throw new Error('Client "' + client + '" is not an object.');
		}

		if (!client.type) {
			throw new Error('Missing client.type attribute: ' + str(client));
		}
	});
}
758508
public void validateUpdateItem(Long configId, String value) {

        //
        // config
        //
        valideConfigExist(configId);

        //
        // value
        //
        try {

            if (StringUtils.isEmpty(value)) {
                throw new Exception();
            }

        } catch (Exception e) {

            throw new FieldException("value", "conf.item.value.null", e);
        }

    }
765564
public function isValidConfig()
    {
        $missing = [];

        foreach ($this->required as $required) {
            if (!array_key_exists($required, $this->txpcfg)) {
                $missing[] = $required;
            }
        }

        if ($missing) {
            throw new \InvalidArgumentException(
                'Textpattern installation missing config values: '.implode(', ', $missing)
            );
        }
    }
69218
private function validateConfig()
    {
        $mustBePositiveKeys = ['maxCyclesToWaitForSession', 'maxSessions', 'minSessions', 'sleepIntervalSeconds'];

        foreach ($mustBePositiveKeys as $key) {
            if ($this->config[$key] < 0) {
                throw new \InvalidArgumentException("$key may not be negative");
            }
        }

        if ($this->config['maxSessions'] < $this->config['minSessions']) {
            throw new \InvalidArgumentException('minSessions cannot exceed maxSessions');
        }

        if (isset($this->config['lock']) && !$this->config['lock'] instanceof LockInterface) {
            throw new \InvalidArgumentException(
                'The lock must implement Google\Cloud\Core\Lock\LockInterface'
            );
        }
    }
800014
public function validateValidatorConfiguration($validatorConfiguration)
    {
        $validationErrors = [];

        if (!is_array($validatorConfiguration)) {
            $validationErrors[] = new ValidationError('Validator configuration must be in form of an array');

            return $validationErrors;
        }

        foreach ($validatorConfiguration as $validatorIdentifier => $constraints) {
            if ($validatorIdentifier !== 'TagsValueValidator') {
                $validationErrors[] = new ValidationError(
                    "Validator '%validator%' is unknown",
                    null,
                    [
                        '%validator%' => $validatorIdentifier,
                    ],
                    "[${validatorIdentifier}]"
                );

                continue;
            }

            if (!is_array($constraints)) {
                $validationErrors[] = new ValidationError('TagsValueValidator constraints must be in form of an array');

                return $validationErrors;
            }

            foreach ($constraints as $name => $value) {
                switch ($name) {
                    case 'subTreeLimit':
                        if (!is_numeric($value)) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be of numeric type",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        if ($value < 0) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be equal or larger than 0",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        if ($value > 0 && !$this->tagsService->loadTagList([$value])) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be an existing tag ID",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        break;
                    case 'maxTags':
                        if (!is_int($value)) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be of integer type",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        if ($value < 0) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be equal or larger than 0",
                                null,
                                [
                                    '%parameter%' => $name,
                                ],
                                "[${validatorIdentifier}][${name}]"
                            );
                        }

                        break;
                    default:
                        $validationErrors[] = new ValidationError(
                            "Validator parameter '%parameter%' is unknown",
                            null,
                            [
                                '%parameter%' => $name,
                            ],
                            "[${validatorIdentifier}][${name}]"
                        );
                }
            }
        }

        return $validationErrors;
    }