Class DefaultRelatedItemsCollector

    • Constructor Detail

      • DefaultRelatedItemsCollector

        public DefaultRelatedItemsCollector()
    • Method Detail

      • collect

        public <T extends ItemModel> java.util.List<ItemModel> collect​(T theSource,
                                                                       java.util.Map<java.lang.String,​java.lang.Object> ctx)
        Description copied from interface: RelatedItemsCollector
        Travers given theSource item against best matching ItemVisitor and returns all collected relatives. Note:
        Specified by:
        collect in interface RelatedItemsCollector
        Type Parameters:
        T - specific model class derived from ItemModel
        Parameters:
        theSource - given item
        ctx - ctx given context
        Returns:
        all relatives for a given theSource item
      • collect

        public <T extends ItemModel> java.util.List<ItemModel> collect​(T theSource,
                                                                       ItemVisitor<T> theStrategy,
                                                                       java.util.Map<java.lang.String,​java.lang.Object> ctx)
        Description copied from interface: RelatedItemsCollector
        Travers given theSource item against given ItemVisitor and returns all collected relatives.
        Specified by:
        collect in interface RelatedItemsCollector
        Type Parameters:
        T - specific model class derived from ItemModel
        Parameters:
        theSource - given item
        theStrategy - given ItemVisitor
        ctx - given context
        Returns:
        all relatives for a given theSource item and given theStrategy
      • collectInternal

        protected void collectInternal​(ItemModel theSource,
                                       java.util.List<ItemModel> collected,
                                       java.util.Map<java.lang.String,​java.lang.Object> ctx,
                                       int currentDepth)
      • extractMaxRecursionDepth

        protected int extractMaxRecursionDepth​(java.util.Map<java.lang.String,​java.lang.Object> ctx)
      • setItemVisitorRegistry

        public void setItemVisitorRegistry​(ItemVisitorRegistry itemVisitorRegistry)