Class DefaultValidationErrorsProvider
java.lang.Object
de.hybris.platform.cmsfacades.common.validator.impl.DefaultValidationErrorsProvider
- All Implemented Interfaces:
ValidationErrorsProvider
Default implementation of
ValidationErrorsProvider. Stores the ValidationErrors instance on the
current Session.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectValidationErrors(ValidationException e, Optional<String> language, Optional<Integer> position) Collects the errors in the validation exception and adds to the global validation context.voidFinalizes the latestValidationErrorsinstance for this transaction.Provides the currentValidationErrorsinstance for this transaction.protected SessionServiceprotected org.springframework.beans.factory.ObjectFactory<ValidationErrors>protected Deque<ValidationErrors>getWrappedStack(Object rawValue) Values stored in the session service must be wrapped in AtomicReference objects to protect them from being altered during serialization.Initializes a newValidationErrorsinstance for this transaction.voidsetSessionService(SessionService sessionService) voidsetValidationErrorsObjectFactory(org.springframework.beans.factory.ObjectFactory<ValidationErrors> validationErrorsObjectFactory)
-
Constructor Details
-
DefaultValidationErrorsProvider
public DefaultValidationErrorsProvider()
-
-
Method Details
-
initializeValidationErrors
Description copied from interface:ValidationErrorsProviderInitializes a newValidationErrorsinstance for this transaction.- Specified by:
initializeValidationErrorsin interfaceValidationErrorsProvider- Returns:
- the current
ValidationErrors
-
getCurrentValidationErrors
Description copied from interface:ValidationErrorsProviderProvides the currentValidationErrorsinstance for this transaction.- Specified by:
getCurrentValidationErrorsin interfaceValidationErrorsProvider- Returns:
- the current
ValidationErrors
-
finalizeValidationErrors
public void finalizeValidationErrors()Description copied from interface:ValidationErrorsProviderFinalizes the latestValidationErrorsinstance for this transaction.- Specified by:
finalizeValidationErrorsin interfaceValidationErrorsProvider
-
collectValidationErrors
public void collectValidationErrors(ValidationException e, Optional<String> language, Optional<Integer> position) Description copied from interface:ValidationErrorsProviderCollects the errors in the validation exception and adds to the global validation context.- Specified by:
collectValidationErrorsin interfaceValidationErrorsProvider- Parameters:
e- the exceptionlanguage- optional; the validated languageposition- optional; the position in which the object value in the collection
-
getWrappedStack
Values stored in the session service must be wrapped in AtomicReference objects to protect them from being altered during serialization. When values are read from the session service, they must be unwrapped. Thus, this method is used to retrieve the original value (stack) stored in the AtomicReference wrapper.- Parameters:
rawValue- Object retrieved from the session service. The object must be an AtomicReference. Otherwise, an IllegalStateException is thrown.- Returns:
- stack stored within the AtomicReference.
-
getSessionService
-
setSessionService
-
getValidationErrorsObjectFactory
protected org.springframework.beans.factory.ObjectFactory<ValidationErrors> getValidationErrorsObjectFactory() -
setValidationErrorsObjectFactory
public void setValidationErrorsObjectFactory(org.springframework.beans.factory.ObjectFactory<ValidationErrors> validationErrorsObjectFactory)
-