Class DefaultCMSLinkComponentValidator
- java.lang.Object
-
- de.hybris.platform.cmsfacades.cmsitems.validator.DefaultCMSLinkComponentValidator
-
- All Implemented Interfaces:
Validator<CMSLinkComponentModel>
public class DefaultCMSLinkComponentValidator extends java.lang.Object implements Validator<CMSLinkComponentModel>
Default implementation of the validator forCMSLinkComponentModel
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSLinkComponentValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CommonI18NServicegetCommonI18NService()protected LanguageFacadegetLanguageFacade()protected ValidationErrorsProvidergetValidationErrorsProvider()protected voidprovideUrlValidationError()Adds a new invalid url error in the list of errors.voidsetCommonI18NService(CommonI18NService commonI18NService)voidsetLanguageFacade(LanguageFacade languageFacade)voidsetValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)voidvalidate(CMSLinkComponentModel validatee)Method to perform validation on a given object.protected voidverifyNameField(CMSLinkComponentModel validatee)Verifies whether the name for the component is provided.protected voidverifyOnlyOneTypeProvided(CMSLinkComponentModel target)Verifies that one of the following is specified: category, content page, product or urlprotected voidverifyUrl(CMSLinkComponentModel validatee)Verifies whether the provided url is valid or not.
-
-
-
Method Detail
-
validate
public void validate(CMSLinkComponentModel validatee)
Description copied from interface:ValidatorMethod to perform validation on a given object.- Specified by:
validatein interfaceValidator<CMSLinkComponentModel>- Parameters:
validatee- the inpected object being validated.
-
verifyUrl
protected void verifyUrl(CMSLinkComponentModel validatee)
Verifies whether the provided url is valid or not. If not an error is added to the list of errors.- Parameters:
validatee- the component to validate.
-
provideUrlValidationError
protected void provideUrlValidationError()
Adds a new invalid url error in the list of errors.
-
verifyNameField
protected void verifyNameField(CMSLinkComponentModel validatee)
Verifies whether the name for the component is provided.- Parameters:
validatee- the component to validate
-
verifyOnlyOneTypeProvided
protected void verifyOnlyOneTypeProvided(CMSLinkComponentModel target)
Verifies that one of the following is specified: category, content page, product or url- Parameters:
target- - the link component dto
-
getValidationErrorsProvider
protected ValidationErrorsProvider getValidationErrorsProvider()
-
setValidationErrorsProvider
public void setValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
getLanguageFacade
protected LanguageFacade getLanguageFacade()
-
setLanguageFacade
public void setLanguageFacade(LanguageFacade languageFacade)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
-