There is a lot (and I mean a LOT) of duplicated code between all three tree processing facilities:
- PojoIndexingProcessorNode
- PojoImplicitReindexingResolverNode
- PojoImplicitReindexingAssociationInverseSideResolverNode
Those are all basically about going through a tree of objects and applying operations to some of them. We’ve already started standardizing that processing with org.hibernate.search.mapper.pojo.extractor.impl.ContainerExtractorHolder#wrap/ValueProcessor (used in PojoIndexingProcessorContainerElementNode and PojoImplicitReindexingResolverContainerElementNode in particular). Maybe we could go one step further and provide generic implementations of value processors that extract a property or apply a typecast? Then we’d use that for all three tree processing facilities, the only specific parts being operations applied to nodes to mark them for reindexin/etc. |