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
A template to be used by
AttributePopulator implementations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ModelServiceprotected abstract booleanisApplicable(TypeAttributeDescriptor attribute, PersistenceContext context) Determines whether a specific implementation can provide value for the specified attribute.protected booleanDetermines 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)
-
Constructor Details
-
AbstractAttributePopulator
public AbstractAttributePopulator()
-
-
Method Details
-
populate
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
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
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
-
setModelService
-