Validate the fields
Throws a JoryException on failure.

@throws JoryException
774577
protected function validateFields(): void
    {
        $fields = $this->getArrayValue($this->joryArray, ['fld', 'fields']);

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

        if (! is_array($fields)) {
            throw new JoryException('The fields parameter must be an array. (Location: '.$this->address.'fields)');
        }

        foreach ($fields as $key => $field) {
            if (! is_string($field)) {
                throw new JoryException('The fields parameter can only contain strings. (Location: '.$this->address.'fields.'.$key.')');
            }
        }
    }
21791
void validate() throws IOException {
		validate(platform, "platform");
		validate(jdk, "JDK");
		validate(executable, "executable name");
		validate(mainClass, "main class");
		validate(outDir, "output folder");

		if (outDir.exists()) {
			if (new File(".").equals(outDir)) {
				throw new IOException("Output directory equals working directory, aborting");
			}
			if (new File("/").equals(outDir)) {
				throw new IOException("Output directory points to root folder.");
			}
		}

		if (classpath.isEmpty()) {
			throw new IOException("Empty class path. Please check your commandline or configuration.");
		}
	}
170162
@Override
    public void validate() throws Exception {
        super.validate();
        this.parse();
        Assert.assertTrue("The upper date should be after the initial date",
                this.upper.after(this.lower));
    }
1002208
protected function detectInvalidJsonFields()
    {
        if (json_encode($this->postFields) === false) {
            $invalidFields = array();
            foreach ($this->postFields as $key => $value) {
                if (json_encode($value) === false) {
                    $invalidFields[] = $key;
                }
            }
            throw new EntityException('Invalid data found in field(s): ' . implode(', ', $invalidFields), EntityException::INVALID_FIELDS);
        }
    }
375312
@Override
    public void validate() throws Exception {
        super.validate();
        new SimpleDateFormat(this.getInput().getValue());
        Assert.assertFalse("Unique attribute isn't applicable for fixed value",
                this.getInput().isUnique());
    }
685373
def validate_fields
      l = Block.serialize self
      RLP.decode(RLP.encode(l)) == l
    end
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);
		}
	}
837632
private void validateFields(List<String> fields) {
        if (fields == null) {
            return;
        }
        List<String> badFields = new ArrayList<String>();
        for (String field: fields) {
            if (field.contains(".")) {
                badFields.add(field);
            }
        }

        if (!badFields.isEmpty()) {
            String msg = String.format("Projection field(s) cannot use dotted notation: %s",
                    Misc.join(", ", badFields));
            logger.log(Level.SEVERE, msg);
            throw new IllegalArgumentException(msg);
        }
    }
29864
@Override
	public void validate() throws AddressStringException {
		if(isValidated()) {
			return;
		}
		synchronized(this) {
			if(isValidated()) {
				return;
			}
			//we know nothing about this address.  See what it is.
			try {
				parsedAddress = getValidator().validateAddress(this);
				isValid = true;
			} catch(AddressStringException e) {
				cachedException = e;
				isValid = false;
				throw e;
			}
		}
	}
1235493
public final List<Throwable> validate() {
        List<Throwable> validationErrors = new ArrayList<>();
        this.accessAssertion.validate(validationErrors, this);

        for (String jdbcDriver: this.jdbcDrivers) {
            try {
                Class.forName(jdbcDriver);
            } catch (ClassNotFoundException e) {
                try {
                    Configuration.class.getClassLoader().loadClass(jdbcDriver);
                } catch (ClassNotFoundException e1) {
                    validationErrors.add(new ConfigurationException(String.format(
                            "Unable to load JDBC driver: %s ensure that the web application has the jar " +
                                    "on its classpath", jdbcDriver)));
                }
            }
        }

        if (this.configurationFile == null) {
            validationErrors.add(new ConfigurationException("Configuration file is field on configuration " +
                                                                    "object is null"));
        }
        if (this.templates.isEmpty()) {
            validationErrors.add(new ConfigurationException("There are not templates defined."));
        }
        for (Template template: this.templates.values()) {
            template.validate(validationErrors, this);
        }

        for (HttpProxy proxy: this.proxies) {
            proxy.validate(validationErrors, this);
        }

        try {
            ColorParser.toColor(this.opaqueTileErrorColor);
        } catch (RuntimeException ex) {
            validationErrors.add(new ConfigurationException("Cannot parse opaqueTileErrorColor", ex));
        }

        try {
            ColorParser.toColor(this.transparentTileErrorColor);
        } catch (RuntimeException ex) {
            validationErrors.add(new ConfigurationException("Cannot parse transparentTileErrorColor", ex));
        }

        if (smtp != null) {
            smtp.validate(validationErrors, this);
        }

        return validationErrors;
    }
964439
public function validate() {

		if ($this->getExternalId() === null) {
			throw new ValidationException("'externalId' can't be null", 'externalId', $this);
		}
		if ($this->getProcessingType() === null) {
			throw new ValidationException("'processingType' can't be null", 'processingType', $this);
		}
		if ($this->getSubscription() === null) {
			throw new ValidationException("'subscription' can't be null", 'subscription', $this);
		}
	}
207857
public void validate() throws IllegalArgumentException, IllegalAccessException {
        for (Field field : getClass().getDeclaredFields()) {
            if (CatalogType.class.isAssignableFrom(field.getType())) {
                CatalogType ct = (CatalogType) field.get(this);
                assert(ct.getCatalog() == getCatalog()) : ct.getCatalogPath() + " has wrong catalog";
            }
            if (CatalogReference.class.isAssignableFrom(field.getType())) {
                @SuppressWarnings("unchecked")
                CatalogReference<? extends CatalogType> cr = (CatalogReference<? extends CatalogType>) field.get(this);
                if (cr.m_value != null) {
                    assert(cr.m_value.getCatalog() == getCatalog()) : cr.m_value.getCatalogPath() + " has wrong catalog";
                }
            }
            if (CatalogMap.class.isAssignableFrom(field.getClass())) {
                @SuppressWarnings("unchecked")
                CatalogMap<? extends CatalogType> cm = (CatalogMap<? extends CatalogType>) field.get(this);
                for (CatalogType ct : cm) {
                    assert(ct.getCatalog() == getCatalog()) : ct.getCatalogPath() + " has wrong catalog";
                    ct.validate();
                }
            }
        }
    }
785756
public function validate() {

		if ($this->getExternalId() === null) {
			throw new ValidationException("'externalId' can't be null", 'externalId', $this);
		}
		if ($this->getReductions() === null) {
			throw new ValidationException("'reductions' can't be null", 'reductions', $this);
		}
		if ($this->getType() === null) {
			throw new ValidationException("'type' can't be null", 'type', $this);
		}
	}
1170969
public void validate() throws InvalidPropertyException {

        final String methodName = "validate";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName);
        }

        final List<String> failedPropsMessages = new ArrayList<String>();
        final List<PropertyDescriptor> invalidProperties = new ArrayList<PropertyDescriptor>();

        try {

            if (isSet(_destinationName))
            {
                // BusName must be set
                if (!isSet(_busName)) {

                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                        SibTr.debug(this, TRACE, "Invalid BusName - BusName was "
                                                 + _busName);
                    }
                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_BUSNAME_CWSIV0504"),
                                                                    null, null));
                    invalidProperties.add(new PropertyDescriptor("BusName",
                                    SibRaActivationSpec.class));

                }

                // DestinationType must be valid
                if (!DESTINATION_TYPES.keySet().contains(_destinationType)) {

                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                        SibTr.debug(this, TRACE,
                                    "Invalid Destination Type - We expected a destination type of "
                                                    + DESTINATION_TYPE_QUEUE + " or " + DESTINATION_TYPE_TOPIC_SPACE + " or "
                                                    + DESTINATION_TYPE_PORT + " or " + DESTINATION_TYPE_SERVICE
                                                    + " but we got "
                                                    + _destinationType);
                    }

                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_DESTINATION_TYPE_CWSIV0505"),
                                                                    new Object[] { DESTINATION_TYPE_QUEUE,
                                                                                  DESTINATION_TYPE_TOPIC_SPACE,
                                                                                  DESTINATION_TYPE_PORT,
                                                                                  DESTINATION_TYPE_SERVICE,
                                                                                  _destinationType }, null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "DestinationType", SibRaActivationSpec.class));

                }

                // Make sure we are not using a topic space if wildcarded destinations are used.
                if ((Boolean.TRUE.equals(_useDestinationWildcard))
                    && (DESTINATION_TYPE_TOPIC_SPACE.equals(_destinationType)))
                {
                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_USEDESTWILDCARD_CWSIV0515"),
                                                                    null, null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "UseDestinationWildcard",
                                    SibRaActivationSpec.class));
                }

                // For durable subscriptions...
                if ((DESTINATION_TYPE_TOPIC_SPACE.equals(_destinationType))
                    && (isSet(_subscriptionName))) {

                    // ShareDurableSubscriptions must be valid
                    if (!SUBSCRIPTION_SHAREABILITY.keySet().contains(
                                                                     _shareDurableSubscriptions)) {

                        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                            SibTr.debug(this, TRACE,
                                        "Invalid shareDurableSubscriptions - We expect a value of "
                                                        + SibRaDurableSubscriptionSharing.ALWAYS + ", "
                                                        + SibRaDurableSubscriptionSharing.NEVER + " or "
                                                        + SibRaDurableSubscriptionSharing.CLUSTER_ONLY + " but we got "
                                                        + _shareDurableSubscriptions);
                        }
                        failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_SHARE_DURSUB_CWSIV0506"),
                                                                        new Object[] { SibRaDurableSubscriptionSharing.ALWAYS,
                                                                                      SibRaDurableSubscriptionSharing.NEVER,
                                                                                      SibRaDurableSubscriptionSharing.CLUSTER_ONLY,
                                                                                      _shareDurableSubscriptions },
                                                                        null));

                        invalidProperties.add(new PropertyDescriptor(
                                        "ShareDurableSubscriptions",
                                        SibRaActivationSpec.class));

                    }

                    // DurableSubscriptionHome must be set
                    if (!isSet(_durableSubscriptionHome)) {

                        failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_DURSUBHOME_CWSIV0507"),
                                                                        null, null));
                        invalidProperties.add(new PropertyDescriptor(
                                        "DurableSubscriptionHome",
                                        SibRaActivationSpec.class));

                    }

                }

            } else {

                // DestinationType must be valid and not a topic space
                if (!DESTINATION_TYPES.keySet().contains(_destinationType)
                    || DESTINATION_TYPE_TOPIC_SPACE
                                    .equals(_destinationType)) {

                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                        SibTr.debug(this, TRACE,
                                    "Invalid Destination Type - No destination was specified so we expected a destination type of "
                                                    + DESTINATION_TYPE_QUEUE + " or " + DESTINATION_TYPE_PORT + " or "
                                                    + DESTINATION_TYPE_SERVICE + " but we got "
                                                    + _destinationType);
                    }

                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_DESTINATION_TYPE_CWSIV0508"),
                                                                    new Object[] { DESTINATION_TYPE_QUEUE,
                                                                                  DESTINATION_TYPE_PORT,
                                                                                  DESTINATION_TYPE_SERVICE,
                                                                                  _destinationType }, null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "DestinationType", SibRaActivationSpec.class));

                }

            }

            // MaxBatchSize must be an Integer greater than zero
            if ((_maxBatchSize == null) || (_maxBatchSize.intValue() < 1)) {

                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_MAXBATCH_CWSIV0509"),
                                                                null, null));
                invalidProperties.add(new PropertyDescriptor("MaxBatchSize",
                                SibRaActivationSpec.class));

            }

            // MessageDeletionMode must be valid
            if (!MESSAGE_DELETION_MODES.keySet().contains(_messageDeletionMode)) {

                if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                    SibTr.debug(this, TRACE,
                                "Invalid Message Deletion Mode we expected a mode of "
                                                + SibRaMessageDeletionMode.SINGLE + " or "
                                                + SibRaMessageDeletionMode.BATCH + " or "
                                                + SibRaMessageDeletionMode.APPLICATION + " but we got "
                                                + _messageDeletionMode);
                }

                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_DELETION_MODE_CWSIV0510"),
                                                                new Object[] { SibRaMessageDeletionMode.SINGLE,
                                                                              SibRaMessageDeletionMode.BATCH,
                                                                              SibRaMessageDeletionMode.APPLICATION,
                                                                              _messageDeletionMode }, null));
                invalidProperties.add(new PropertyDescriptor(
                                "MessageDeletionMode", SibRaActivationSpec.class));

            }

            // MaxConcurrency must be an Integer greater than zero
            if ((_maxConcurrency == null) || (_maxConcurrency.intValue() < 1)) {

                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_MAXCONC_CWSIV0511"),
                                                                null, null));
                invalidProperties.add(new PropertyDescriptor("MaxConcurrency",
                                SibRaActivationSpec.class));

            }

            /**
             * For the target set of properties, use the defaults if none specified
             */

            if ("".equals(_targetType)) {

                _targetType = JmsraConstants.DEFAULT_TARGET_TRANSPORT;

            }

            if ("".equals(_target)) {

                _target = JmsraConstants.DEFAULT_TARGET;

            }

            // Target type must be one of the predefined values
            if ((null == _targetType) || ("".equals(_targetType))) {

                _targetType = JmsraConstants.DEFAULT_TARGET_TYPE;

            } else {

                if (!((ApiJmsConstants.TARGET_TYPE_BUSMEMBER.equals(_targetType)) ||
                      (ApiJmsConstants.TARGET_TYPE_ME.equals(_targetType)) || (ApiJmsConstants.TARGET_TYPE_CUSTOM.equals(_targetType)))) {

                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_TARGET_TYPE_CWSIV0512"),
                                                                    new Object[] { ApiJmsConstants.TARGET_TYPE_BUSMEMBER,
                                                                                  ApiJmsConstants.TARGET_TYPE_ME,
                                                                                  ApiJmsConstants.TARGET_TYPE_CUSTOM,
                                                                                  _targetType },
                                                                    null));

                    invalidProperties.add(new PropertyDescriptor(
                                    "targetType",
                                    SibRaActivationSpec.class));

                }

            }

            // Target significance must be one of the predefined values
            if ((null == _targetSignificance) || ("".equals(_targetSignificance))) {

                _targetSignificance = JmsraConstants.DEFAULT_TARGET_SIGNIFICANCE;

            } else {

                if (!((ApiJmsConstants.TARGET_SIGNIFICANCE_PREFERRED.equals(_targetSignificance)) || (ApiJmsConstants.TARGET_SIGNIFICANCE_REQUIRED.equals(_targetSignificance)))) {

                    failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_TARGET_SIGNIFICANCE_CWSIV0513"),
                                                                    new Object[] { ApiJmsConstants.TARGET_SIGNIFICANCE_PREFERRED,
                                                                                  ApiJmsConstants.TARGET_SIGNIFICANCE_REQUIRED,
                                                                                  _targetSignificance },
                                                                    null));
                    invalidProperties.add(new PropertyDescriptor(
                                    "targetSignificance",
                                    SibRaActivationSpec.class));

                }

            }

            if ((_useServerSubject.booleanValue()) && (isSet(_providerEndpoints)))
            {
                failedPropsMessages.add(NLS.getFormattedMessage(("INVALID_PROPERTY_PROVIDER_ENDPOINTS_CWSIV0514"),
                                                                new Object[] { _providerEndpoints },
                                                                null));
                invalidProperties.add(new PropertyDescriptor(
                                "providerEndpoints",
                                SibRaActivationSpec.class));
            }

        } catch (final IntrospectionException exception) {

            FFDCFilter.processException(exception, CLASS_NAME + "."
                                                   + methodName, FFDC_PROBE_1, this);
            // Should never happen

        }

        // If we have any invalid properties, throw an
        // InvalidPropertyException
        if (!invalidProperties.isEmpty()) {

            final PropertyDescriptor[] invalidPropertyArray = (PropertyDescriptor[]) invalidProperties
                            .toArray(new PropertyDescriptor[invalidProperties
                                            .size()]);

            if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
                SibTr.debug(this, TRACE, "Invalid properties found:",
                            failedPropsMessages);
            }

            final InvalidPropertyException exc = new InvalidPropertyException(
                            NLS.getFormattedMessage(
                                                    ("INVALID_PROPERTIES_CWSIV0501"),
                                                    new Object[] { this, failedPropsMessages }, null));
            exc.setInvalidPropertyDescriptors(invalidPropertyArray);
            throw exc;
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
1370108
def validate( self ):
        """"""
        klass = self.__class__

        for name in klass._fields:
            self.validate_field( name )
        return
1247687
@com.fasterxml.jackson.annotation.JsonProperty("validationErrors")
    public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new java.util.ArrayList<ValidationError>(validationErrors);
    }
697427
@SuppressWarnings("unchecked")
	private static ValidationFail performFieldValidations(Context context, FieldInfo fieldInfo, View view) {
		// first, we need to check if condition is not applied for all validations on field
		if (fieldInfo.condition != null && fieldInfo.condition.validationAnnotation().equals(Condition.class)) {
			// condition is applied to all validations on field
			boolean evaluation = evaluateCondition(view, fieldInfo.condition);
			if (! evaluation) {
				// go to next field
				return null;
			}
		}

		// field validations
		for (ValidationInfo valInfo : fieldInfo.validationInfoList) {
			final Annotation annotation = valInfo.annotation;
			if (fieldInfo.condition != null && fieldInfo.condition.validationAnnotation().equals(annotation.annotationType())) {
				boolean evaluation = evaluateCondition(view, fieldInfo.condition);

				if (! evaluation) {
					// continue to next annotation
					continue;
				}
			}
			final IFieldAdapter adapter = FieldAdapterFactory.getAdapterForField(view, annotation);
			if (adapter == null) {
				throw new NoFieldAdapterException(view, annotation);
			}

			final Object value = adapter.getFieldValue(annotation, view);
			final boolean isValid = valInfo.validator.validate(annotation, value);

			if (! isValid) {
				final String message = valInfo.validator.getMessage(context, annotation, value);
				final int order = valInfo.validator.getOrder(annotation);

				// no more validations on this field
				return new ValidationFail(view, message, order);
			}
		}
		return null;
	}