Class BundleTemplateNonLeafValidator
java.lang.Object
de.hybris.platform.configurablebundleservices.constraints.TypeValidatorHelper
de.hybris.platform.configurablebundleservices.constraints.BasicBundleTemplateValidator<BundleTemplateNonLeaf>
de.hybris.platform.configurablebundleservices.constraints.BundleTemplateNonLeafValidator
- All Implemented Interfaces:
javax.validation.ConstraintValidator<BundleTemplateNonLeaf,BundleTemplateModel>
public class BundleTemplateNonLeafValidator
extends BasicBundleTemplateValidator<BundleTemplateNonLeaf>
Triggers when one of the
BundleTemplateModel.getRequiredBundleTemplates()
does not belong to the parent package of the model.-
Field Summary
Fields inherited from class de.hybris.platform.configurablebundleservices.constraints.TypeValidatorHelper
MESSAGE_PARAMETER_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisNonLeaf(BundleTemplateModel item) Checks if item is non-leaf.protected booleanisRelationValid(Collection<BundleTemplateModel> collection, javax.validation.ConstraintValidatorContext context, String fieldName) Checks if relations contain non-leaf nodes, and for each non-leaf node add error message.booleanisValid(BundleTemplateModel value, javax.validation.ConstraintValidatorContext context) Methods inherited from class de.hybris.platform.configurablebundleservices.constraints.BasicBundleTemplateValidator
initializeMethods inherited from class de.hybris.platform.configurablebundleservices.constraints.TypeValidatorHelper
buildErrorMessage, getCurrentLocale, getI18nService, getLocalizedString, getResourceBundleProvider
-
Constructor Details
-
BundleTemplateNonLeafValidator
public BundleTemplateNonLeafValidator()
-
-
Method Details
-
isValid
public boolean isValid(BundleTemplateModel value, javax.validation.ConstraintValidatorContext context) -
isRelationValid
protected boolean isRelationValid(Collection<BundleTemplateModel> collection, javax.validation.ConstraintValidatorContext context, String fieldName) Checks if relations contain non-leaf nodes, and for each non-leaf node add error message.- Parameters:
collection- the relationscontext- the ConstraintValidatorContextfieldName- the name of relation.- Returns:
- true if relations has no non-leaf nodes, false - otherwise.
-
isNonLeaf
Checks if item is non-leaf.- Parameters:
item- - the BundleTemplateModel to check- Returns:
- true if item is non-leaf, false - otherwise.
-