Skeleton validation, triggering validate on any subComponents

@param section the configuration section; should often be hard-coded
@throws ConfigException validation failure
15656
@SuppressWarnings("rawtypes")
    @Override
    public void basicValidate(final String section) throws ConfigException {
        ConfigurationUtils.defaultValidate((ConfigurationComponent) this, section);
    }
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);
        }

    }
435419
public function validate(): void
    {
        $required = [
            'app_root',
            'app_name',
            'default_filesystem',
            'environment',
            'default_branch',
            'default_database_adapter',
            'default_database_importexport_adapter',
            'default_dir_mode',
            'default_file_mode',
            'platform',
            'relative_document_root',
            'repo_url',
        ];
        $missingRequired = [];
        foreach ($required as $name) {
            if (empty($this->config[$name])) {
                $missingRequired[] = $name;
            }
        }
        if ($missingRequired) {
            throw new Exception\RuntimeException(
                'Missing required values for top level configuration key(s): "' . implode('", "', $missingRequired)
                . '"'
            );
        }

        if (!in_array(
            $this->config['file_layout'],
            [
                FileLayoutInterface::STRATEGY_BLUE_GREEN,
                FileLayoutInterface::STRATEGY_DEFAULT
            ]
        )) {
            throw new Exception\DomainException("Invalid file layout \"{$this->config['file_layout']}\".");
        }

        $this->buildConfig->validate();
        $this->deployConfig->validate();
        $this->snapshotConfig->validate();
        $this->skeletonConfig->validate();
    }
812654
@Override
  public void ensureValid(String setting, Object value) {
    if (null == value || !(value instanceof Integer)) {
      throw new ConfigException(setting, "Must be an integer.");
    }
    final Integer port = (Integer) value;

    if (!(port >= this.start && port <= this.end)) {
      throw new ConfigException(
          setting,
          String.format("(%s) must be between %s and %s.", port, this.start, this.end)
      );
    }
  }
237166
def set(self, section, option, value=None):
        """"""
        _, option, value = self._validate_value_types(option=option, value=value)
        super(ConfigParser, self).set(section, option, value)
162734
public static <T> void validate(Request<T> request) throws ValidationConstraintViolationException {
		if (request != null) {
			Class<?> clazz = request.getClass();
			List<ConstraintViolation> leafs = new LinkedList<ConstraintViolation>();

			Field[] fields = clazz.getDeclaredFields();
			for (Field field : fields) {
				if (null != field.getAnnotation(Required.class)) {

					field.setAccessible(true);
					Object value = null;
					try {
						value = field.get(request);
					} catch (Exception e) {
						// not cool...
						throw new ValidationConstraintViolationException(e);
					}

					if (value == null || value instanceof String && ((String) value).isEmpty()) {
						ConstraintViolation violation = ConstraintViolation.newConstraintViolation("@" + Required.class.getSimpleName(), field);
						leafs.add(violation);
					}
				}
			}

			if (!leafs.isEmpty()) {
				throw new ValidationConstraintViolationException(preMessage, leafs);
			}
		}
	}
1360370
public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
        throws Exception
    {
        final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
            .xsdFilename(System.getProperty(VALIDATION_XSD))
            .xIncludeAware(Boolean.parseBoolean(System.getProperty(XINCLUDE_AWARE)))
            .stopOnError(Boolean.parseBoolean(System.getProperty(VALIDATION_STOP_ON_ERROR)))
            .warningsFatal(Boolean.parseBoolean(System.getProperty(VALIDATION_WARNINGS_FATAL)))
            .suppressOutput(Boolean.parseBoolean(System.getProperty(VALIDATION_SUPPRESS_OUTPUT)));

        final Path path = Paths.get(sbeSchemaFilename);
        try (InputStream in = new BufferedInputStream(Files.newInputStream(path)))
        {
            final InputSource inputSource = new InputSource(in);
            if (path.toAbsolutePath().getParent() != null)
            {
                inputSource.setSystemId(path.toUri().toString());
            }

            XmlSchemaParser.validate(xsdFilename, inputSource, optionsBuilder.build());
        }
    }
1023720
def _validate(self, sam_template):
        

        if "Resources" not in sam_template or not isinstance(sam_template["Resources"], dict) \
                or not sam_template["Resources"]:
            raise InvalidDocumentException(
                [InvalidTemplateException("'Resources' section is required")])

        SamTemplateValidator.validate(sam_template)
569204
public void validate() throws ConfigurationException
    {
        // if chunk length was not set (chunkLength == null), this is fine, default will be used
        if (chunkLength != null)
        {
            if (chunkLength <= 0)
                throw new ConfigurationException("Invalid negative or null " + CHUNK_LENGTH_KB);

            int c = chunkLength;
            boolean found = false;
            while (c != 0)
            {
                if ((c & 0x01) != 0)
                {
                    if (found)
                        throw new ConfigurationException(CHUNK_LENGTH_KB + " must be a power of 2");
                    else
                        found = true;
                }
                c >>= 1;
            }
        }

        validateCrcCheckChance(crcCheckChance);
    }
591076
@Override
    public void validateConfig(ServerConfiguration configuration) throws ConfigValidationException {

        // Default is that drop-ins are enabled
        boolean dropinsEnabled = configuration.isDropinsEnabled();

        // Drop-ins are enabled
        if (dropinsEnabled) {
            Tr.fatal(tc, "fatal.configValidator.dropinsEnabled");

            // Throw exception to terminate the server
            throw new ConfigValidationException("Drop-ins enabled in embedded environment");
        }

    }
928495
@Override
	protected void validateComponent(final List<Diagnostic> diags) {
		super.validateComponent(diags);

		if (!isEmpty()) {
			String value = getValueAsString();

			// Maximum Length
			int max = getMaxLength();

			if (max > 0 && value.length() > max) {
				diags.add(
						createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_MAX_LENGTH,
								this,
								String.valueOf(max)));
			}

			// Minimum Length
			int min = getMinLength();

			if (min > 0 && value.length() < min) {
				diags.add(
						createErrorDiagnostic(InternalMessages.DEFAULT_VALIDATION_ERROR_MIN_LENGTH,
								this,
								String.valueOf(min)));
			}

			// Pattern
			Pattern pattern = getComponentModel().pattern;
			if (pattern != null) {
				Matcher matcher = pattern.matcher(value);
				if (!matcher.matches()) {
					diags.add(createErrorDiagnostic(
							InternalMessages.DEFAULT_VALIDATION_ERROR_INVALID_PATTERN, this));
				}
			}
		}
	}
767617
public void validateAndSubmit() {

        CmsValidationController validationController = new CmsValidationController(
            m_fields.values(),
            new I_CmsValidationHandler() {

                /**
                 * @see org.opencms.gwt.client.validation.I_CmsValidationHandler#onValidationFinished(boolean)
                 */
                public void onValidationFinished(boolean ok) {

                    m_formHandler.onSubmitValidationResult(CmsForm.this, ok);
                }

                /**
                 * @see org.opencms.gwt.client.validation.I_CmsValidationHandler#onValidationResult(java.lang.String, org.opencms.gwt.shared.CmsValidationResult)
                 */
                public void onValidationResult(String field, CmsValidationResult result) {

                    updateFieldValidationStatus(field, result);

                }

            });
        validationController.setFormValidator(m_validatorClass);
        validationController.setFormValidatorConfig(createValidatorConfig());
        startValidation(validationController);
    }
1358661
public void validate(final Runnable nextAction) {

        validateFull(m_structureId, getAliasPaths(), new AsyncCallback<Map<String, String>>() {

            public void onFailure(Throwable caught) {

                // do nothing

            }

            public void onSuccess(Map<String, String> result) {

                for (Map.Entry<String, String> entry : result.entrySet()) {
                    if (entry.getValue() != null) {
                        m_hasValidationErrors = true;
                    }
                }
                m_defaultValidationHandler.onSuccess(result);
                nextAction.run();
            }
        });
    }
1016915
void perform(SectionState state) throws SAXException {
    final ModeUsage modeUsage = getModeUsage();
    state.reject();
    state.addChildMode(modeUsage, null);
    state.addAttributeValidationModeUsage(modeUsage);
  }
924474
@Override
    public ValidationResult<?> validate(final OptionalConfigurationComponent<?> configurationComponent) {
        if (configurationComponent instanceof ValidatingConfigurationComponent) {
            @SuppressWarnings("rawtypes")
            final ValidatingConfigurationComponent<?> validatingComponent = (ValidatingConfigurationComponent) configurationComponent;
            return validatingComponent.validate();
        } else {
            final Class<?> componentClass = configurationComponent.getClass();
            final Validator<?> validator = validators.get(componentClass);
            if (validator != null) {
                @SuppressWarnings({"unchecked", "rawtypes"})
                final ValidationResult<?> validationResult = ((Validator) validator).validate(configurationComponent);
                return validationResult;
            } else {
                throw new IllegalArgumentException("No validator for class " + componentClass.getCanonicalName());
            }
        }
    }
958123
private void validate() {
        LibraryUtils.checkArgumentNotNull(config, "configuration is null");
        LibraryUtils.checkArgumentNotNull(exceptionHandler, "exceptionHandler is null");
        LibraryUtils.checkArgumentNotNull(progressReporter, "progressReporter is null");
        LibraryUtils.checkArgumentNotNull(s3Client, "s3Client is null");
    }
222573
@Override
    public void validate() throws ConfigurationException {
        if (host == null || host.length() == 0) {
            this.host = "localhost";
        }
        if (port == null || port.length() == 0) {
            this.port = "12345";
        }
    }