Class BundleTemplateNonLeafValidator

    • Constructor Detail

      • BundleTemplateNonLeafValidator

        public BundleTemplateNonLeafValidator()
    • 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 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.