Class BaseAttributeContentConverter<T>
java.lang.Object
de.hybris.platform.cms2.cmsitems.converter.impl.BaseAttributeContentConverter<T>
- Type Parameters:
T- type parameter. Is used as aPredicateargument 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertDataToModel(T attribute, Object source) Converts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.convertModelToData(T attribute, Object source) Converts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.Returns the predicate that constrains the converter.voidsetConstrainedBy(Predicate<T> constrainedBy) voidsetDataToModelConverter(Converter<Object, Object> dataToModelConverter) voidsetModelToDataConverter(Converter<Object, Object> modelToDataConverter)
-
Constructor Details
-
BaseAttributeContentConverter
public BaseAttributeContentConverter()
-
-
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<T>- Returns:
- the predicate related with the converter. Never
null.
-
setConstrainedBy
-
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<T>- 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<T>- Parameters:
attribute- 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.
-
getModelToDataConverter
-
setModelToDataConverter
-
getDataToModelConverter
-
setDataToModelConverter
-