グループを指定して検証を実行する。
@param record 検証対象のオブジェクト。
@param bindingErrors エラーオブジェクト
@param validationContext 入力値検証のためのコンテキスト情報
@param groups BeanValiationのグループのクラス
431429
public void validate(final Object record, final CsvBindingErrors bindingErrors, 
            final ValidationContext<Object> validationContext, final Class<?>... groups) {
        Objects.requireNonNull(record);
        Objects.requireNonNull(bindingErrors);
        Objects.requireNonNull(validationContext);
        
        processConstraintViolation(getTargetValidator().validate(record, groups), bindingErrors, validationContext);
    }
556392
@Override
    public ValidationResult validate(PMContext ctx) {
        final ValidationResult res = new ValidationResult();
        final String fieldvalue = (String) ctx.getFieldValue();
        res.setSuccessful(true);
        if (!isName(fieldvalue)) {
            res.setSuccessful(false);
            res.getMessages().add(MessageFactory.error(ctx.getEntity(), ctx.getField(), get("msg", "")));
        }
        return res;
    }
1363825
public static function validate($object, $groups = null)
    {
        static::initialize();
        $errors = static::$validator->validate($object, null, $groups);
        if ($errors->count() != 0) {
            //Throw new exception containing the errors
            throw new ValidationFailedException($errors, $object);
        }
    }
110692
@Override
    public void validate(final FacesContext context) {
        if (context == null) {
            throw new NullPointerException();
        }

        final Validator[] validators = getValidators();
        final Object value = getValue();

        if (!validateRequired(context, value)) {
            return;
        }

        if (validators == null) {
            return;
        }

        for (final Validator validator : validators) {
            try {
                validator.validate(context, this, value);
            }
            catch (final ValidatorException ve) {
                // If the validator throws an exception, we're
                // invalid, and we need to add a message
                setValid(false);
                FacesMessage message;
                final String validatorMessageString = getValidatorMessage();

                if (null != validatorMessageString) {
                    message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                validatorMessageString,
                                validatorMessageString);
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                }
                else {
                    final Collection<FacesMessage> messages = ve.getFacesMessages();
                    if (null != messages) {
                        message = null;
                        final String cid = getClientId(context);
                        for (final FacesMessage m : messages) {
                            context.addMessage(cid, m);
                        }
                    }
                    else {
                        message = ve.getFacesMessage();
                    }
                }
                if (message != null) {
                    final Sheet sheet = getSheet();
                    if (sheet == null) {
                        return;
                    }
                    context.addMessage(getClientId(context), message);
                    sheet.getInvalidUpdates().add(
                                new SheetInvalidUpdate(sheet.getRowKeyValue(context), sheet.getColumns().indexOf(this), this, value,
                                            message.getDetail()));

                }
            }
        }

    }
283488
@SuppressWarnings({"unchecked"})
  public final ArrayList<ConstraintViolation<?>> getValidationErrorSet(final Object pclass) {
    return new ArrayList<>(validationErrorSet.stream()
        .map(violation -> ConstraintViolationImpl.forBeanValidation( //
            violation.getMessageTemplate(), //
            Collections.emptyMap(), //
            Collections.emptyMap(), //
            violation.getMessage(), //
            ((SerializeableConstraintValidationImpl<Object>) violation).getRootBeanClass(), //
            pclass, //
            violation.getLeafBean(), //
            null, //
            violation.getPropertyPath(), //
            violation.getConstraintDescriptor(), //
            null, //
            null))
        .collect(Collectors.toList()));
  }
1049487
public CsvField<T> validate(final CsvBindingErrors bindingErrors) {
        Objects.requireNonNull(bindingErrors);
        
        for(CsvFieldValidator<T> validator : getValidators()) {
            if(hasError(bindingErrors)) {
                return this;
            }
            
            validator.validate(bindingErrors, this);
        }
        
        return this;
        
    }
228214
public boolean validateSFGrouper(SFGrouper sfGrouper, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return validate_EveryDefaultConstraint(sfGrouper, diagnostics, context);
	}
981304
public function processValidationErrors(array $validationErrors): void
    {
        if (empty($validationErrors)) {
            return;
        }

        $propertyPathGenerator = $this->propertyPathGenerator;
        foreach ($validationErrors as $i => $error) {
            $message = $error->getTranslatableMessage();
            /** @var \Symfony\Component\Validator\Violation\ConstraintViolationBuilderInterface $violationBuilder */
            $violationBuilder = $this->context->buildViolation($message instanceof Plural ? $message->plural : $message->message);
            $violationBuilder->setParameters($message->values);

            if ($propertyPathGenerator !== null) {
                $propertyPath = $propertyPathGenerator($i, $error->getTarget());
                if ($propertyPath) {
                    $violationBuilder->atPath($propertyPath);
                }
            }

            $violationBuilder->addViolation();
        }
    }
816557
void handleValidationChange(CmsValidationContext validationContext) {

        if (validationContext.hasValidationErrors()) {
            String locales = "";
            for (String id : validationContext.getInvalidEntityIds()) {
                if (locales.length() > 0) {
                    locales += ", ";
                }
                String locale = CmsContentDefinition.getLocaleFromId(id);
                if (m_availableLocales.containsKey(locale)) {
                    locales += m_availableLocales.get(locale);
                }
            }
            disableSave(Messages.get().key(Messages.GUI_TOOLBAR_VALIDATION_ERRORS_1, locales));
        } else if (!m_changedEntityIds.isEmpty()) {
            enableSave();
        }
    }
886266
public static @Nonnull FormValidation aggregate(@Nonnull Collection<FormValidation> validations) {
        if (validations == null || validations.isEmpty()) return FormValidation.ok();

        if (validations.size() == 1) return validations.iterator().next();

        final StringBuilder sb = new StringBuilder("<ul style='list-style-type: none; padding-left: 0; margin: 0'>");
        FormValidation.Kind worst = Kind.OK;
        for (FormValidation validation: validations) {
            sb.append("<li>").append(validation.renderHtml()).append("</li>");

            if (validation.kind.ordinal() > worst.ordinal()) {
                worst = validation.kind;
            }
        }
        sb.append("</ul>");

        return respond(worst, sb.toString());
    }
1216437
private void validateGroupByItem(SqlSelect select, SqlNode groupByItem) {
		final SqlValidatorScope groupByScope = getGroupScope(select);
		groupByScope.validateExpr(groupByItem);
	}
1274998
@Override
	public void bind(Object context) {
		if (m_validationEngine != null && context instanceof ValidationObject) {
	        m_validationSession = m_validationEngine.createSession();
	        m_validationSession.bind((ValidationObject) context);
		}
	}
30624
public void initDataGroup(ParamType paramType, List<ValidationData> lists) {
        this.paramType = paramType;

        lists.forEach(vd -> {
            this.addRule(vd);
        });

    }
1000066
protected void validateGroupClause(SqlSelect select) {
		SqlNodeList groupList = select.getGroup();
		if (groupList == null) {
			return;
		}
		final String clause = "GROUP BY";
		validateNoAggs(aggOrOverFinder, groupList, clause);
		final SqlValidatorScope groupScope = getGroupScope(select);
		inferUnknownTypes(unknownType, groupScope, groupList);

		// expand the expression in group list.
		List<SqlNode> expandedList = new ArrayList<>();
		for (SqlNode groupItem : groupList) {
			SqlNode expandedItem = expandGroupByOrHavingExpr(groupItem, groupScope, select, false);
			expandedList.add(expandedItem);
		}
		groupList = new SqlNodeList(expandedList, groupList.getParserPosition());
		select.setGroupBy(groupList);
		for (SqlNode groupItem : expandedList) {
			validateGroupByItem(select, groupItem);
		}

		// Nodes in the GROUP BY clause are expressions except if they are calls
		// to the GROUPING SETS, ROLLUP or CUBE operators; this operators are not
		// expressions, because they do not have a type.
		for (SqlNode node : groupList) {
			switch (node.getKind()) {
				case GROUPING_SETS:
				case ROLLUP:
				case CUBE:
					node.validate(this, groupScope);
					break;
				default:
					node.validateExpr(this, groupScope);
			}
		}

		// Derive the type of each GROUP BY item. We don't need the type, but
		// it resolves functions, and that is necessary for deducing
		// monotonicity.
		final SqlValidatorScope selectScope = getSelectScope(select);
		AggregatingSelectScope aggregatingScope = null;
		if (selectScope instanceof AggregatingSelectScope) {
			aggregatingScope = (AggregatingSelectScope) selectScope;
		}
		for (SqlNode groupItem : groupList) {
			if (groupItem instanceof SqlNodeList
				&& ((SqlNodeList) groupItem).size() == 0) {
				continue;
			}
			validateGroupItem(groupScope, aggregatingScope, groupItem);
		}

		SqlNode agg = aggFinder.findAgg(groupList);
		if (agg != null) {
			throw newValidationError(agg, RESOURCE.aggregateIllegalInClause(clause));
		}
	}
603928
protected Set<ConstraintViolation<Object>> hibernateValidate(Object form, Class<?>[] groups) {
        try {
            return hibernateValidator.validate(form, groups);
        } catch (RuntimeException e) {
            handleHibernateValidatorException(form, groups, e);
            return null; // unreachable
        }
    }
1074035
public void validateEditDetails(GroupForm group, MessageContext context) {

        // ensure the group name is set
        if (StringUtils.isBlank(group.getName())) {
            context.addMessage(
                    new MessageBuilder().error().source("name").code("please.enter.name").build());
        }
    }
170779
public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new com.amazonaws.internal.SdkInternalList<ValidationError>(validationErrors);
    }