Class AbstractAttributePopulator
- java.lang.Object
-
- de.hybris.platform.inboundservices.persistence.populator.AbstractAttributePopulator
-
- All Implemented Interfaces:
AttributePopulator
- Direct Known Subclasses:
AbstractCollectionAttributePopulator,AbstractMapAttributePopulator,ItemModelAttributePopulator,ItemModelAttributePopulator,PartOfAttributePopulator,PrimitiveAttributePopulator,ReplaceItemModelCollectionAttributePopulator,ReplaceItemModelCollectionAttributePopulator,ReplacePrimitiveCollectionAttributePopulator
public abstract class AbstractAttributePopulator extends java.lang.Object implements AttributePopulator
A template to be used byAttributePopulatorimplementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractAttributePopulator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ModelServicegetModelService()protected abstract booleanisApplicable(TypeAttributeDescriptor attribute, PersistenceContext context)Determines whether a specific implementation can provide value for the specified attribute.protected booleanisNew(ItemModel item)Determines whether the specified item is new or not.voidpopulate(ItemModel model, PersistenceContext context)Populates attributes of the specifiedItemModel.protected abstract voidpopulateAttribute(ItemModel item, TypeAttributeDescriptor attribute, PersistenceContext context)Populates value of the specified item attribute.voidsetModelService(ModelService service)
-
-
-
Method Detail
-
populate
public void populate(ItemModel model, PersistenceContext context)
Populates attributes of the specifiedItemModel.This implementation excludes attributes, which are not applicable for this populator, and for the rest it delegates to
populateAttribute(ItemModel, TypeAttributeDescriptor, PersistenceContext)- Specified by:
populatein interfaceAttributePopulator- Parameters:
model- a model to populate attributes in.context- a context carrying all information needed to know, which attributes need to be populated and how they should- See Also:
isApplicable(TypeAttributeDescriptor, PersistenceContext),populateAttribute(ItemModel, TypeAttributeDescriptor, PersistenceContext)
-
isApplicable
protected abstract boolean isApplicable(TypeAttributeDescriptor attribute, PersistenceContext context)
Determines whether a specific implementation can provide value for the specified attribute.- Parameters:
attribute- attribute to make the decision about.context- context that may be needed to make the decision.- Returns:
true, if this attribute processor is applicable to the specified attribute and can provide a value for it;false, otherwise.
-
populateAttribute
protected abstract void populateAttribute(ItemModel item, TypeAttributeDescriptor attribute, PersistenceContext context)
Populates value of the specified item attribute.- Parameters:
item- item model to be populated.attribute- specifies, which attribute should be populated in theitem.context- context information necessary to derive correct attribute value from the integration item.
-
isNew
protected boolean isNew(ItemModel item)
Determines whether the specified item is new or not.- Parameters:
item- an item to check- Returns:
true, if the item is new and has not been persisted yet;false, if the item already exists in the persistent storage.
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService service)
-
-