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 theBundleTemplateModel.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 Constructor Description BundleTemplateNonLeafValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisNonLeaf(BundleTemplateModel item)Checks if item is non-leaf.protected booleanisRelationValid(java.util.Collection<BundleTemplateModel> collection, javax.validation.ConstraintValidatorContext context, java.lang.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
initialize
-
Methods inherited from class de.hybris.platform.configurablebundleservices.constraints.TypeValidatorHelper
buildErrorMessage, getCurrentLocale, getI18nService, getLocalizedString, getResourceBundleProvider
-
-
-
-
Method Detail
-
isValid
public boolean isValid(BundleTemplateModel value, javax.validation.ConstraintValidatorContext context)
-
isRelationValid
protected boolean isRelationValid(java.util.Collection<BundleTemplateModel> collection, javax.validation.ConstraintValidatorContext context, java.lang.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
protected boolean isNonLeaf(BundleTemplateModel item)
Checks if item is non-leaf.- Parameters:
item- - the BundleTemplateModel to check- Returns:
- true if item is non-leaf, false - otherwise.
-
-