Interface CockpitValidationService
- All Known Implementing Classes:
DefaultCockpitValidationService
public interface CockpitValidationService
The Interface CockpitValidationService.
-
Method Summary
Modifier and TypeMethodDescriptionbuildFormattedValidationMessages(Set<CockpitValidationDescriptor> validationInfo) Builds the html formatted validation messages as big formatted message which could be used on frontend.buildValidationMessages(Set<CockpitValidationDescriptor> validationInfo, String sep) Builds the validation messages as big formatted message which could be used on frontend.booleancontainsLevel(Set<CockpitValidationDescriptor> validationInfo, int level) Contains level.convertToValidationDescriptors(Set<HybrisConstraintViolation> constraintViolations) Convert to validation descriptors.filterByMessageLevel(Set<CockpitValidationDescriptor> violations, int cockpitMessageLevel) Filters set ofCockpitValidationDescriptorby message level.intgetCockpitMessageLevel(Severity severity) Gets the cockpit message level.intgetHighestMessageLevel(Set<CockpitValidationDescriptor> validationInfo) Gets the highest severity.getTypeValidationDescriptors(Set<CockpitValidationDescriptor> violations) Gets the validation descriptors for type constraints only.getValidationDescriptors(Set<CockpitValidationDescriptor> violations, PropertyDescriptor propertyDescriptor) Gets the validation descriptors for passed in propertyDescriptor.validateModel(ItemModel newItemModel) Validate modelvalidateProperty(T object, PropertyDescriptor property) Validate property.
-
Method Details
-
buildFormattedValidationMessages
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
Builds the validation messages as big formatted message which could be used on frontend.- Parameters:
validationInfo- the validation infosep- the separator for messages- Returns:
- the string
-
containsLevel
Contains level.- Parameters:
validationInfo- the validation infolevel- 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 ofCockpitValidationDescriptorby message level.- Parameters:
violations- the violationscockpitMessageLevel- the cockpit message level- Returns:
- the set
-
getCockpitMessageLevel
Gets the cockpit message level.- Parameters:
severity- the severity- Returns:
- the cockpit message level
-
getHighestMessageLevel
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 descriptorviolations- the violations- Returns:
- the validation descriptors
-
validateModel
Validate model- Parameters:
newItemModel- the new item model- Returns:
- the set< cockpit validation descriptor>
-
validateProperty
Validate property.- Type Parameters:
T-- Parameters:
object- the object to validateproperty- the property to validate- Returns:
- the cockpit validation descriptor
-