Class 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.
  • 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 relations
      context - the ConstraintValidatorContext
      fieldName - 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.