Interface CockpitValidationService

    • Method Detail

      • buildFormattedValidationMessages

        java.lang.String buildFormattedValidationMessages​(java.util.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

        java.lang.String buildValidationMessages​(java.util.Set<CockpitValidationDescriptor> validationInfo,
                                                 java.lang.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​(java.util.Set<CockpitValidationDescriptor> validationInfo,
                              int level)
        Contains level.
        Parameters:
        validationInfo - the validation info
        level - the level
        Returns:
        true, if successful
      • convertToValidationDescriptors

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

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

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

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

        java.util.Set<CockpitValidationDescriptor> getValidationDescriptors​(java.util.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

        java.util.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