Interface CockpitValidationService

All Known Implementing Classes:
DefaultCockpitValidationService

public interface CockpitValidationService
The Interface CockpitValidationService.
  • Method Details

    • buildFormattedValidationMessages

      String buildFormattedValidationMessages(Set<CockpitValidationDescriptor> validationInfo)
      Builds the html formatted validation messages as big formatted message which could be used on frontend.
      Parameters:
      validationInfo - the validation info
      Returns:
      the string
    • buildValidationMessages

      String buildValidationMessages(Set<CockpitValidationDescriptor> validationInfo, String sep)
      Builds the validation messages as big formatted message which could be used on frontend.
      Parameters:
      validationInfo - the validation info
      sep - the separator for messages
      Returns:
      the string
    • containsLevel

      boolean containsLevel(Set<CockpitValidationDescriptor> validationInfo, int level)
      Contains level.
      Parameters:
      validationInfo - the validation info
      level - the level
      Returns:
      true, if successful
    • convertToValidationDescriptors

      Set<CockpitValidationDescriptor> convertToValidationDescriptors(Set<HybrisConstraintViolation> constraintViolations)
      Convert to validation descriptors.
      Parameters:
      constraintViolations - the constraint violations
      Returns:
      the property desriptors
    • filterByMessageLevel

      Set<CockpitValidationDescriptor> filterByMessageLevel(Set<CockpitValidationDescriptor> violations, int cockpitMessageLevel)
      Filters set of CockpitValidationDescriptor by message level.
      Parameters:
      violations - the violations
      cockpitMessageLevel - the cockpit message level
      Returns:
      the set
    • getCockpitMessageLevel

      int getCockpitMessageLevel(Severity severity)
      Gets the cockpit message level.
      Parameters:
      severity - the severity
      Returns:
      the cockpit message level
    • getHighestMessageLevel

      int getHighestMessageLevel(Set<CockpitValidationDescriptor> validationInfo)
      Gets the highest severity.
      Parameters:
      validationInfo - the validation info
      Returns:
      the highest severity
    • getTypeValidationDescriptors

      Set<CockpitValidationDescriptor> getTypeValidationDescriptors(Set<CockpitValidationDescriptor> violations)
      Gets the validation descriptors for type constraints only.
      Parameters:
      violations - the violations
      Returns:
      the type validation descriptors
    • getValidationDescriptors

      Set<CockpitValidationDescriptor> getValidationDescriptors(Set<CockpitValidationDescriptor> violations, PropertyDescriptor propertyDescriptor)
      Gets the validation descriptors for passed in propertyDescriptor. Method will do search only in the list of attribute constraints.
      Parameters:
      propertyDescriptor - the property descriptor
      violations - the violations
      Returns:
      the validation descriptors
    • validateModel

      Set<CockpitValidationDescriptor> validateModel(ItemModel newItemModel)
      Validate model
      Parameters:
      newItemModel - the new item model
      Returns:
      the set< cockpit validation descriptor>
    • validateProperty

      <T> CockpitValidationDescriptor validateProperty(T object, PropertyDescriptor property)
      Validate property.
      Type Parameters:
      T -
      Parameters:
      object - the object to validate
      property - the property to validate
      Returns:
      the cockpit validation descriptor