Class EnumAttributeContentConverter

java.lang.Object
de.hybris.platform.cmsfacades.cmsitems.attributeconverters.EnumAttributeContentConverter
All Implemented Interfaces:
AttributeContentConverter<AttributeDescriptorModel>

public class EnumAttributeContentConverter extends Object implements AttributeContentConverter<AttributeDescriptorModel>
Implementation of AttributeContentConverter that converts properties of type Enum
  • Constructor Details

    • EnumAttributeContentConverter

      public EnumAttributeContentConverter()
  • Method Details

    • getConstrainedBy

      public Predicate<AttributeDescriptorModel> getConstrainedBy()
      Description copied from interface: AttributeContentConverter
      Returns the predicate that constrains the converter. This predicate will be tested against a given attribute descriptor and if this predicate is true, then it applies the conversion,
      Specified by:
      getConstrainedBy in interface AttributeContentConverter<AttributeDescriptorModel>
      Returns:
      the predicate related with the converter. Never null.
    • convertModelToData

      public Object convertModelToData(AttributeDescriptorModel attribute, Object source)
      Description copied from interface: AttributeContentConverter
      Converts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.
      Specified by:
      convertModelToData in interface AttributeContentConverter<AttributeDescriptorModel>
      Parameters:
      attribute - the object describing the source
      source - the persistent source described by the attribute that needs be converted to some serializable representation
      Returns:
      the converter instance. Never null.
    • convertDataToModel

      public Object convertDataToModel(AttributeDescriptorModel attributeDescriptor, Object source)
      Description copied from interface: AttributeContentConverter
      Converts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.
      Specified by:
      convertDataToModel in interface AttributeContentConverter<AttributeDescriptorModel>
      Parameters:
      attributeDescriptor - the object describing the source
      source - the serializable representation described by the attribute that needs be converted to some persistent property
      Returns:
      the converter instance. Never null.
    • getAttributeClass

      protected Class getAttributeClass(AttributeDescriptorModel attributeDescriptor)
      This method gets the class of the attribute described by the given descriptor.
      Parameters:
      attributeDescriptor - - The descriptor of the attribute whose class to retrieve.
      Returns:
      the class associated to the given attribute descriptor.
    • isDynamicEnum

      protected boolean isDynamicEnum(Class enumClass)
      This method is used to check if the given class is a dynamic enumeration.
      Parameters:
      enumClass - - The class to check
      Returns:
      true if the class represents a dynamic enum. false, otherwise.
    • setAttributeDescriptorModelHelperService

      public void setAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService)
    • getAttributeDescriptorModelHelperService

      protected AttributeDescriptorModelHelperService getAttributeDescriptorModelHelperService()
    • setIsEnumPredicate

      public void setIsEnumPredicate(EnumTypeAttributePredicate isEnumPredicate)
    • getIsEnumPredicate

      protected EnumTypeAttributePredicate getIsEnumPredicate()
    • getEnumerationService

      protected EnumerationService getEnumerationService()
    • setEnumerationService

      public void setEnumerationService(EnumerationService enumerationService)