Validate the data given in the constructor
Throws a JoryException on failure.

@throws JoryException on failure
330386
public function validate(): void
    {
        $this->validateRootFilter();
        $this->validateRelations();
        $this->validateSorts();
        $this->validateOffset();
        $this->validateLimit();
        $this->validateFields();
    }
508232
public function validate() {

		if ($this->getFieldName() === null) {
			throw new ValidationException("'fieldName' can't be null", 'fieldName', $this);
		}
		if ($this->getSorting() === null) {
			throw new ValidationException("'sorting' can't be null", 'sorting', $this);
		}
	}
359286
public function validate() {
		$errors = array();
		if ($this->getType() == self::TYPE_DECLARATIVE) {
			$classDescriptor = $this->getClassDescriptor();
			$constructor = $classDescriptor->getConstructor();
			
			if ($constructor) {
				$params = $constructor->getParameters();
				
				$i=0;
				
				foreach ($params as $param) {
					/* @var $param MoufReflectionParameter */
					if (!$param->isOptional()) {
						if (!$this->moufManager->isParameterSetForConstructor($this->getIdentifierName(), $i)) {
							$name = $this->getIdentifierName();
							if ($this->isAnonymous()) {
								$name = "anonymous instance of class ".$this->getClassName();
							}
							$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is compulsory.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
						} elseif (!$param->allowsNull()) {
							$name = $this->getIdentifierName();
							if ($this->isAnonymous()) {
								$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
							}
							if ($this->moufManager->getParameterForConstructor($this->getIdentifierName(), $i) === null) {
								$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is null, but the constructor signature does not allow it to be null.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
							}
						}
					}
					if ($this->moufManager->getParameterTypeForConstructor($this->getIdentifierName(), $i) == 'php') {
						$name = $this->getIdentifierName();
						// Ok, we need to check the code.
						$code = $this->moufManager->getParameterForConstructor($name, $i);
						try {
							CodeValidatorService::validateCode($code);
						} catch (Error $e) {
							if ($this->isAnonymous()) {
								$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
							}
							$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
						}
					}		
					$i++;
				}
			}
			
			foreach ($classDescriptor->getInjectablePropertiesByPublicProperty() as $propertyName=>$moufProperty) {
				$property = $this->getPublicFieldProperty($propertyName);
				if ($property->getOrigin() == 'php') {
					$code = $property->getValue();
					try {
						CodeValidatorService::validateCode($code);
					} catch (Error $e) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
						$errors[] = "In instance <em>".$name."</em>, the public property
									'".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
													<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				}
			}
			
			foreach ($classDescriptor->getInjectablePropertiesBySetter() as $propertyName=>$moufProperty) {
				$property = $this->getSetterProperty($propertyName);
				if ($property->getOrigin() == 'php') {
					$code = $property->getValue();
					try {
						CodeValidatorService::validateCode($code);
					} catch (Error $e) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
						$errors[] = "In instance <em>".$name."</em>, the setter
									'".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
											<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				}
			}
			
			// Now, let's check that the MoufManager instance definition is not using properties that where once declared
			// but that no longer exist in the class:
			
			$definedPublicProperties = $this->moufManager->getParameterNames($this->name);
			if ($definedPublicProperties) {
				$missingPublicProperties = array_diff($definedPublicProperties, array_keys($classDescriptor->getInjectablePropertiesByPublicProperty()));
				foreach ($missingPublicProperties as $missingPublicPropertyName) {
					$name = $this->getIdentifierName();
					if ($this->isAnonymous()) {
						$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
					}
					
					$errors[] = "In instance <em>".$name."</em>, the public property
								'".$missingPublicPropertyName."' is declared but does not exist. It is likely it once existed but was renamed or removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
			}
			
			$definedSetters = $this->moufManager->getParameterNamesForSetter($this->name);
			if ($definedSetters) {
				$missingSetters = array_diff($definedSetters, array_keys($classDescriptor->getInjectablePropertiesBySetter()));
				foreach ($missingSetters as $missingSetterName) {
					$name = $this->getIdentifierName();
					if ($this->isAnonymous()) {
						$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
					}
				
					$errors[] = "In instance <em>".$name."</em>, the setter
								'".$missingSetterName."()' is declared but does not exist. It is likely it once existed but was renamed or removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
			}
			
			$definedConstructorArguments = $this->moufManager->getParameterNamesForConstructor($this->name);
			if ($definedConstructorArguments) {
				$constructor = $classDescriptor->getConstructor();
				if ($constructor) {
					$nbParameters = $classDescriptor->getConstructor()->getNumberOfParameters();
					$missingConstructorArguments = array_filter($definedConstructorArguments, function($nb) use ($nbParameters) { return $nbParameters <= $nb; });
					foreach ($missingConstructorArguments as $missingArgument) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
					
						$errors[] = "In instance <em>".$name."</em>, the constructor argument
								n°".$missingArgument." is used but does not exist. It is likely it once existed but was removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				} else {
					$name = $this->getIdentifierName();
					$errors[] = "In instance <em>".$name."</em>, parameters are injected in the constructor but the constructor does not exist. It is likely it once existed but was removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
				
				
			}
				
		} else {
			$error = $this->moufManager->getErrorOnInstanceCode($this->getIdentifierName());
			if ($error) {
				$name = $this->getIdentifierName();
				if ($this->isAnonymous()) {
					$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
				}
				$errors[] = "The instance <em>".$name."</em> is declared by PHP code and is throwing an error message:
								$error
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
			}
		}
		return $errors;
	}
900127
protected function validate_data() {
        parent::validate_data();
        // Make sure this class is never used without proper object details.
        if (!$this->contextlevel === CONTEXT_MODULE) {
            throw new \coding_exception('Context level must be CONTEXT_MODULE.');
        }
        if (!isset($this->other['pagetype'])) {
            throw new \coding_exception('The \'pagetype\' value must be set in other.');
        }
    }
189306
public function validate() {
		parent::validate();

		if ($this->getName() === null) {
			throw new ValidationException("'name' can't be null", 'name', $this);
		}
		if ($this->getType() === null) {
			throw new ValidationException("'type' can't be null", 'type', $this);
		}
	}
713012
protected void validate() {
    // make sure that the source uri is set correctly.
    if (mSourceUri == null) {
      throw new BuilderException("Source must be set!");
    }

    // For local resource we require caller to specify statically generated resource id as a path.
    if (UriUtil.isLocalResourceUri(mSourceUri)) {
      if (!mSourceUri.isAbsolute()) {
        throw new BuilderException("Resource URI path must be absolute.");
      }
      if (mSourceUri.getPath().isEmpty()) {
        throw new BuilderException("Resource URI must not be empty");
      }
      try {
        Integer.parseInt(mSourceUri.getPath().substring(1));
      } catch (NumberFormatException ignored) {
        throw new BuilderException("Resource URI path must be a resource id.");
      }
    }

    // For local asset we require caller to specify absolute path of an asset, which will be
    // resolved by AssetManager relative to configured asset folder of an app.
    if (UriUtil.isLocalAssetUri(mSourceUri) && !mSourceUri.isAbsolute()) {
      throw new BuilderException("Asset URI path must be absolute.");
    }
  }
1027718
@Override
    public void validate() {

        if (entityClass == null) {
            throw new IllegalArgumentException("testentity class cannot be null");
        }

        if (!entityClass.isAnnotationPresent(DeepEntity.class)) {
            throw new AnnotationTypeMismatchException(null, entityClass.getCanonicalName());
        }

        super.validate();

        /* let's validate fieldNames in @DeepField annotations */
        Field[] deepFields = AnnotationUtils.filterDeepFields(entityClass);

        Map<String, Cell> colDefs = super.columnDefinitions();

        /* colDefs is null if table does not exist. I.E. this configuration will be used as an output configuration
         object, and the output table is dynamically created */
        if (colDefs == null) {
            return;
        }

        for (Field field : deepFields) {
            String annotationFieldName = AnnotationUtils.deepFieldName(field);

            if (!colDefs.containsKey(annotationFieldName)) {
                throw new DeepNoSuchFieldException("Unknown column name \'" + annotationFieldName + "\' specified for" +
                        " field " + entityClass.getCanonicalName() + "#" + field.getName() + ". Please, " +
                        "make sure the field name you specify in @DeepField annotation matches _exactly_ the column " +
                        "name " +
                        "in the database");
            }
        }
    }
663056
protected function validate_data() {
        parent::validate_data();

        if (!isset($this->relateduserid)) {
            throw new \coding_exception('The \'relateduserid\' must be set.');
        }

        if (!isset($this->objectid)) {
            throw new \coding_exception('The \'objectid\' must be set.');
        }
    }
548927
@Override
    public void verify(VerificationData data) {
        try {
            verification.verify(data);

        } catch (MockitoAssertionError e) {
            throw new MockitoAssertionError(e, description);
        }
    }
85546
public function validate() {
		parent::validate();

		if ($this->getEntity() === null) {
			throw new ValidationException("'entity' can't be null", 'entity', $this);
		}
		if ($this->getEntityStates() === null) {
			throw new ValidationException("'entityStates' can't be null", 'entityStates', $this);
		}
		if ($this->getUrl() === null) {
			throw new ValidationException("'url' can't be null", 'url', $this);
		}
	}
732206
function validate()
    {
        //If both start and end contain something
        if($this->end && $this->start)
        {
            //Validate the parent (check the primary key)
            parent::validate();
        }

        //A node is missing
        else
        {
            //Start annotation is missing
            if($this->end)
            {
                throw new Exception("Class {$this->getName()} contains no targets for @Start.");
            }

            //End annotation is missing
            else
            {
                throw new Exception("Class {$this->getName()} contains no targets for @End.");
            }
        }
    }
751747
protected function validateLimit(): void
    {
        $limit = $this->getArrayValue($this->joryArray, ['lmt', 'limit']);

        // No limit set, that's ok. return.
        if ($limit === null) {
            return;
        }

        if (! is_int($limit)) {
            throw new JoryException('The limit parameter should be an integer value. (Location: '.$this->address.'limit)');
        }
    }
988014
protected function validate_data() {
        parent::validate_data();
        if (!isset($this->context)) {
            throw new \coding_exception('The \'context\' must be set.');
        }
        if (!isset($this->objectid)) {
            throw new \coding_exception('The \'objectid\' must be set.');
        }
        if (!isset($this->other['eventtype'])) {
            throw new \coding_exception('The \'eventtype\' value must be set in other.');
        }
        if ($this->other['eventtype'] == 'course' || $this->other['eventtype'] == 'group') {
            if (!isset($this->other['courseid'])) {
                throw new \coding_exception('The \'courseid\' value must be set in other.');
            }
            if ($this->other['eventtype'] == 'group' && !isset($this->other['groupid'])) {
                throw new \coding_exception('The \'groupid\' value must be set in other.');
            }
        }
        if ($this->other['eventtype'] == 'category' && !isset($this->other['categoryid'])) {
            throw new \coding_exception('The \'categoryid\' value must be set in other.');
        }
    }
367128
@Override
  public void validate(T arg) throws ValidationException {
    for (final Validator<T> validator : validators) {
      validator.validate(arg);
    }
  }
59895
@Override
  public void validate()
    throws ConfigException
  {
    for (int i = 0; i < _jarList.size(); i++) {
      _jarList.get(i).validate();
    }
  }
237058
private void validate() {
        if(driverClass == null) {
            throw new IllegalArgumentException("Driver class must be specified");
        }
        if(catalog == null || catalog.isEmpty()) {
            throw new IllegalArgumentException("Schema name must be specified");
        }
        if(table == null || table.isEmpty()) {
            throw new IllegalArgumentException("Table name must be specified");
        }
        if(connectionUrl == null || connectionUrl.isEmpty()) {
            if((host != null && !host.isEmpty()) && (port > 0)) {
                connectionUrl(getJdbcUrl());
            } else {
                throw new IllegalArgumentException("You must specify at least one of connectionUrl or host and port properties");
            }
        }
        if(partitionKey == null && numPartitions > 1) {
            throw new IllegalArgumentException("You must define a valid partition key for using more than one partition.");
        }
    }
233366
public function validate() {

		if ($this->getConsumedUnits() === null) {
			throw new ValidationException("'consumedUnits' can't be null", 'consumedUnits', $this);
		}
		if ($this->getExternalId() === null) {
			throw new ValidationException("'externalId' can't be null", 'externalId', $this);
		}
		if ($this->getMetric() === null) {
			throw new ValidationException("'metric' can't be null", 'metric', $this);
		}
		if ($this->getSubscription() === null) {
			throw new ValidationException("'subscription' can't be null", 'subscription', $this);
		}
	}