Class BaseAttributeContentConverter<T>

java.lang.Object
de.hybris.platform.cms2.cmsitems.converter.impl.BaseAttributeContentConverter<T>
Type Parameters:
T - type parameter. Is used as a Predicate argument as well as in convertModelToData and convertModelToData methods.
All Implemented Interfaces:
AttributeContentConverter<T>
Direct Known Subclasses:
DefaultAttributeContentConverter, VersionAttributeContentConverter

public class BaseAttributeContentConverter<T> extends Object implements AttributeContentConverter<T>
Base and generic implementation of AttributeContentConverter.
  • Constructor Details

    • BaseAttributeContentConverter

      public BaseAttributeContentConverter()
  • Method Details

    • getConstrainedBy

      public Predicate<T> 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<T>
      Returns:
      the predicate related with the converter. Never null.
    • setConstrainedBy

      public void setConstrainedBy(Predicate<T> constrainedBy)
    • convertModelToData

      public Object convertModelToData(T 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<T>
      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(T attribute, 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<T>
      Parameters:
      attribute - 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.
    • getModelToDataConverter

      protected Converter<Object,Object> getModelToDataConverter()
    • setModelToDataConverter

      public void setModelToDataConverter(Converter<Object,Object> modelToDataConverter)
    • getDataToModelConverter

      protected Converter<Object,Object> getDataToModelConverter()
    • setDataToModelConverter

      public void setDataToModelConverter(Converter<Object,Object> dataToModelConverter)