Class AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>
- java.lang.Object
-
- de.hybris.platform.cmsfacades.synchronization.itemvisitors.AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE>
-
- Type Parameters:
CMSCOMPONENTTYPE- the component type that extendsAbstractCMSComponentModel
- All Implemented Interfaces:
ItemVisitor<CMSCOMPONENTTYPE>
- Direct Known Subclasses:
AbstractCMSComponentContainerModelVisitor,AbstractMediaContainerComponentModelVisitor,CMSLinkComponentModelVisitor,DefaultAbstractCMSComponentModelVisitor,NavigationBarCollectionComponentModelVisitor,NavigationBarComponentModelVisitor,NavigationComponentModelVisitor
public abstract class AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel> extends java.lang.Object implements ItemVisitor<CMSCOMPONENTTYPE>
Abstract class for visitingAbstractCMSComponentModelmodels for the cms synchronization service to work properly. In this implementation, it will collect all component's child (collection or not) extending or beingCMSItemModel
-
-
Constructor Summary
Constructors Constructor Description AbstractCMSComponentModelVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcollectChildItems(CMSCOMPONENTTYPE source, java.util.List<ItemModel> toVisit, AttributeDescriptorModel attributeDescriptorModel)Collects all child items of typeCMSItemModelfor the provided source component.protected AttributeDescriptorModelHelperServicegetAttributeDescriptorModelHelperService()protected java.lang.ObjectgetAttributeValue(CMSCOMPONENTTYPE source, AttributeDescriptorModel attributeDescriptorModel)Gets the value by calling the getter for the attribute defined by the provided attribute descriptor.protected ModelServicegetModelService()protected TypeServicegetTypeService()protected booleanisClassAssignableFrom(java.lang.Class clazz, AttributeDescriptorModel attributeDescriptor)voidsetAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService)voidsetModelService(ModelService modelService)voidsetTypeService(TypeService typeService)java.util.List<ItemModel>visit(CMSCOMPONENTTYPE source, java.util.List<ItemModel> arg1, java.util.Map<java.lang.String,java.lang.Object> arg2)Returns visited items for a giventheSourceitem within given contestctx
-
-
-
Method Detail
-
visit
public java.util.List<ItemModel> visit(CMSCOMPONENTTYPE source, java.util.List<ItemModel> arg1, java.util.Map<java.lang.String,java.lang.Object> arg2)
Description copied from interface:ItemVisitorReturns visited items for a giventheSourceitem within given contestctx- Specified by:
visitin interfaceItemVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>- Parameters:
source- given itemarg1- path to given itemarg2- visitor context- Returns:
- relevant items for a given
theSourceitem
-
collectChildItems
protected void collectChildItems(CMSCOMPONENTTYPE source, java.util.List<ItemModel> toVisit, AttributeDescriptorModel attributeDescriptorModel)
Collects all child items of typeCMSItemModelfor the provided source component.- Parameters:
source- - the component which attributes is inspected to collect child itemstoVisit- - the list of items collected which will be used by the synchronization serviceattributeDescriptorModel- - the attribute descriptor object containing the information about the attribute of interest
-
getAttributeValue
protected java.lang.Object getAttributeValue(CMSCOMPONENTTYPE source, AttributeDescriptorModel attributeDescriptorModel)
Gets the value by calling the getter for the attribute defined by the provided attribute descriptor.When the attribute is not readable (due to configurations in *items.xml), the ModelService will return an
AttributeNotSupportedExceptionand the attribute will not be added to the list of items to visit by the synchronization service.- Parameters:
source- - the source object which the getter method will be calledattributeDescriptorModel- - the attribute descriptor object containing the information about the attribute of interest- Returns:
- the result of the getter; can be
NULL
-
isClassAssignableFrom
protected boolean isClassAssignableFrom(java.lang.Class clazz, AttributeDescriptorModel attributeDescriptor)
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getAttributeDescriptorModelHelperService
protected AttributeDescriptorModelHelperService getAttributeDescriptorModelHelperService()
-
setAttributeDescriptorModelHelperService
public void setAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService)
-
-