Object metaDataSourceObject,
List<ModelValidationEntry> modelValidationEntryList,
List<Class> restrictedGroupsForModelValidation,
boolean processMetaDataForValidation)
{
ModelValidationEntry modelValidationEntry = new ModelValidationEntry();
List<Class> groupClassList = createGroupClassList(beanValidation, processMetaDataForValidation);
modelValidationEntry.setGroups(groupClassList);
modelValidationEntry.setDisplayMessageInline(beanValidation.modelValidation().displayInline());
modelValidationEntry.setCustomMessage(beanValidation.modelValidation().message());
modelValidationEntry.setMetaDataSourceObject(metaDataSourceObject);
Object validationTarget;
for (String validationTargetExpression : beanValidation.modelValidation().validationTargets())
{
if (ModelValidation.DEFAULT.equals(validationTargetExpression))
{
continue;
}
validationTarget = tryToResolveValidationTargetExpression(validationTargetExpression);
if (validationTarget != null)
{
modelValidationEntry.addValidationTarget(validationTarget);
}
}
if (beanValidation.restrictGroups().length > 0)
{
restrictedGroupsForModelValidation.addAll(Arrays.asList(beanValidation.restrictGroups()));
}
if (modelValidationEntry.getValidationTargets().isEmpty())
{
modelValidationEntry.addValidationTarget(metaDataSourceObject);
}
modelValidationEntryList.add(modelValidationEntry);
}