cancel
Showing results for 
Search instead for 
Did you mean: 

CategoryHierarchyPopulator and CatalogOption

Former Member
0 Kudos

CatalogOption is an enum. So it cannot be extended. Then, if we want to extend the CategoryHierarchyPopulator using our custom CatalogOption, our new populator cannot extend from CategoryHierarchyPopulator.

This is the current implementation of the CategoryHierarchyPopulator:

 @Override
 public void populate(final CategoryModel source, final CategoryHierarchyData target,
         final Collection<? extends CatalogOption> options, final PageOption page) throws ConversionException

Take a look to third argument. Nothing can extend from CatalogOption. I think it should be a spring bean.

View Entire Topic
El-jaoujat
Active Participant
0 Kudos

Hi,

You are right , You could not extend this populator with enum other than CatalogOption ,it's really strange they put it like this , Enum is final by design and could not be extended .

an option is to forget about extending and write your own implementation of the interface PageablePopulator<SOURCE, TARGET, OPTION> and substitute the OPTION param with your own enum .