The validate method
322966
@Override
    public ValidationResult validate(PMContext ctx) {
        final ValidationResult res = new ValidationResult();
        final Object object = ctx.getFieldValue();
        final String fieldId = ctx.getField().getId();

        if (object instanceof String) {
            String fieldvalue = (String) object;
            res.setSuccessful(true);
            Integer len = fieldvalue.length();
            Integer maxl = getInt("max-length");
            if (maxl != null) {
                if (len > maxl) {
                    res.setSuccessful(false);
                    res.getMessages().add(MessageFactory.error(
                            ctx.getEntity(), ctx.getField(),
                            get("max-length-msg", "pm_core.validator.toolong"),
                            fieldId, len.toString(), maxl.toString()));
                }
            }
            Integer minl = getInt("min-length");
            if (minl != null) {
                if (len < minl) {
                    res.setSuccessful(false);
                    res.getMessages().add(MessageFactory.error(
                            ctx.getEntity(), ctx.getField(),
                            get("min-length-msg", "pm_core.validator.tooshort"),
                            fieldId, len.toString(), minl.toString()));
                }
            }
        } else {
            res.setSuccessful(false);
            res.getMessages().add(MessageFactory.error(
                    ctx.getEntity(), ctx.getField(),
                    "pm_core.validator.fieldnotstring",
                    fieldId));
        }
        return res;
    }
586823
protected function validate()
    {
        $args = $this->dispatcher->getParam('args');
        if (isset($this->actions[$this->actionName])) {
            $action = $this->actions[$this->actionName];
            $action->validate($args);
        }
    }
542343
private void validate() {

    if ((this.segments.length < 0) && (!this.snapshot)) {
      throw new IllegalArgumentException("segments.length:" + Integer.valueOf(this.segments.length));
    }
    for (int i = 0; i < this.segments.length; i++) {
      if (this.segments[i] < 0) {
        throw new IllegalArgumentException("segments[" + i + "]:" + Integer.valueOf(this.segments[i]));
      }
    }
    if (this.phaseNumber != null) {
      if (this.phaseNumber.intValue() < 0) {
        throw new IllegalArgumentException("phaseNumber:" + this.phaseNumber);
      }
      if (this.phase == null) {
        throw new IllegalArgumentException("phaseNumber (phase==null):" + this.phaseNumber);
      }
      if ((this.phase == DevelopmentPhase.RELEASE) && (this.phaseNumber.intValue() != 0)) {
        throw new IllegalArgumentException("phaseNumber (phase==RELEASE):" + this.phaseNumber);
      }
    }
  }
397821
function validate(args, required) {
    var result = {
      error: false,
      message: 'No errors'
    }

    // ensure required properties were passed in the arguments hash
    if (required) {
      var keys = _.keys(args);
      required.forEach(function(field) {
        if(!_.contains(keys, field)) {
          result.error = true;
          result.message = 'The following values must be passed: ' + required.join(', ');
        }
      })
    }

    return result;

  }
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;
			}
		}
	}
818399
function validate() {
  const errors = [].concat(
    _validateStore(),
    _validatePassword(),
    _validateThemeId(),
  );

  return {
    errors,
    isValid: errors.length === 0,
  };
}
1289076
def validate(input)
      (check_exists(required_inputs, input) &&
        check_format(input_formats, input)) || 
      (raise Errors::InvalidInput, "Invalid input for #{self.class.name}")
    end
1275374
def Validate(self):
    """"""
    self._ValidateReturnedTypes()
    self._ValidatePaths()
    self._ValidateType()
    self._ValidateRequiredAttributes()
    self._ValidateCommandArgs()
339238
function validMethod(req, res, next) {
    if (httpMethods.indexOf(req.method) === -1) {
        res.sendStatus(405);
    } else {
        next();
    }
}
145494
def validate_or_raise(self, *a, **k):
        
        
        validate, err = self.validate(*a, **k)
        
        if err:
            raise ValidationException(err)
        
        return validate
643160
def Validate(self):
    """"""
    if not self.check_id:
      raise DefinitionError("Check has missing check_id value")
    cls_name = self.check_id
    if not self.method:
      raise DefinitionError("Check %s has no methods" % cls_name)
    ValidateMultiple(self.method,
                     "Check %s has invalid method definitions" % cls_name)
1106652
function validate(doc, schema, prefix, options) {
  schema.validate(doc, prefix, options);
}
27359
private function validate()
    {
        if ($this->hasValidated) {
            return;
        }

        $this->checkDepth();

        foreach ($this->schema as $rule => $parameter) {
            $this->currentKeyword   = $rule;
            $this->currentParameter = $parameter;
            $this->mergeErrors($this->validateRule($rule, $parameter));
            $this->currentKeyword = $this->currentParameter = null;
        }

        $this->hasValidated = true;
    }
1262864
public function validate() : void
    {
        if (null === $this->is_valid) {
            if (null === $this->user_value && null !== $this->default_value) {
                // There is a preset value, and its not being changed
                $this->is_valid = true;
            } elseif (null != $this->validator && false != $this->validator) {
                if ('' === $this->user_value && false === $this->required) {
                    $this->is_valid = true;
                    return;
                } elseif ('' === $this->user_value && true === $this->required) {
                    $this->is_valid = false;
                    return;
                }
                try {
                    $validator = $this->validator;
                    $result = $validator::quickValidate($this->user_value, $this->constraints);
                    $this->user_value = $result;
                    $this->is_valid = true;
                } catch (InvalidInputException $e) {
                    $this->user_value = null;
                    $this->is_valid = false;
                    $this->error = $e->getMessage();
                }

            } else {
                // This field does not get validated
                $this->is_valid = true;
            }
        }
        // Check if the input is different from the default value
        if ($this->is_valid && null !== $this->user_value) {
            $this->is_changed = ($this->default_value != $this->user_value);
        }
    }
1211331
def _validate(self):
        
        errors = {}

        for name, validator in self._validators.items():
            value = getattr(self, name)

            try:
                validator(self, value)
            except ValidationError as e:
                errors[name] = str(e)

        self._validate_errors = errors
222724
private void validate() {
        if (host.isEmpty()) {
            throw new IllegalArgumentException("host cannot be null");
        }
        if (catalog == null) {
            throw new IllegalArgumentException("namespace cannot be null");
        }
        if (table == null) {
            throw new IllegalArgumentException("set cannot be null");
        }
        if (portList.isEmpty()) {
            if(port>0){
                port(port);
            }else{
                throw new IllegalArgumentException("port cannot be null");
            }

        }
        if (host.size() != portList.size()) {
            throw new IllegalArgumentException("Host and ports cardinality must be the same");
        }

    }
674018
def validate(self):
        """"""
        super().validate()
        nb_entities = len(self.entities)
        if nb_entities != self.rows + self.columns:
            raise self.error(
                'Number of entities: %s != number of rows + '
                'number of columns: %s+%s=%s' % (
                    nb_entities, self.rows, self.columns,
                    self.rows + self.columns))