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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertDataToModel(AttributeDescriptorModel attributeDescriptor, Object source) Converts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.convertModelToData(AttributeDescriptorModel attribute, Object source) Converts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.protected ClassgetAttributeClass(AttributeDescriptorModel attributeDescriptor) This method gets the class of the attribute described by the given descriptor.protected AttributeDescriptorModelHelperServiceReturns the predicate that constrains the converter.protected EnumerationServiceprotected EnumTypeAttributePredicateprotected booleanisDynamicEnum(Class enumClass) This method is used to check if the given class is a dynamic enumeration.voidsetAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService) voidsetEnumerationService(EnumerationService enumerationService) voidsetIsEnumPredicate(EnumTypeAttributePredicate isEnumPredicate)
-
Constructor Details
-
EnumAttributeContentConverter
public EnumAttributeContentConverter()
-
-
Method Details
-
getConstrainedBy
Description copied from interface:AttributeContentConverterReturns the predicate that constrains the converter. This predicate will be tested against a given attribute descriptor and if this predicate istrue, then it applies the conversion,- Specified by:
getConstrainedByin interfaceAttributeContentConverter<AttributeDescriptorModel>- Returns:
- the predicate related with the converter. Never
null.
-
convertModelToData
Description copied from interface:AttributeContentConverterConverts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.- Specified by:
convertModelToDatain interfaceAttributeContentConverter<AttributeDescriptorModel>- Parameters:
attribute- the object describing the sourcesource- the persistent source described by the attribute that needs be converted to some serializable representation- Returns:
- the converter instance. Never
null.
-
convertDataToModel
Description copied from interface:AttributeContentConverterConverts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.- Specified by:
convertDataToModelin interfaceAttributeContentConverter<AttributeDescriptorModel>- Parameters:
attributeDescriptor- the object describing the sourcesource- the serializable representation described by the attribute that needs be converted to some persistent property- Returns:
- the converter instance. Never
null.
-
getAttributeClass
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
This method is used to check if the given class is a dynamic enumeration.- Parameters:
enumClass- - The class to check- Returns:
trueif the class represents a dynamic enum.false, otherwise.
-
setAttributeDescriptorModelHelperService
public void setAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService) -
getAttributeDescriptorModelHelperService
-
setIsEnumPredicate
-
getIsEnumPredicate
-
getEnumerationService
-
setEnumerationService
-