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 Object implements AttributePopulator
A template to be used by AttributePopulator implementations.
  • Constructor Details

    • AbstractAttributePopulator

      public AbstractAttributePopulator()
  • Method Details

    • populate

      public void populate(ItemModel model, PersistenceContext context)
      Populates attributes of the specified ItemModel.

      This implementation excludes attributes, which are not applicable for this populator, and for the rest it delegates to populateAttribute(ItemModel, TypeAttributeDescriptor, PersistenceContext)

      Specified by:
      populate in interface AttributePopulator
      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 the item.
      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)