public class DefaultRelatedItemsCollector extends Object implements RelatedItemsCollector
RelatedItemsCollector. It assume existence of
ItemVisitorRegistry which uses for matching best or given ItemVisitor.
Note:
Travers given theSource item against ItemVisitor and collects all catalog aware
relatives for a given item. Relatives items are traversed using the same approach i.e. the method calls are
recursive.
Note:
Just to optimize you can pass RelatedItemsCollector.MAX_RECURSION_DEPTH to ctx as a parameter
that express max recursion depth.
MAX_RECURSION_DEPTH| Constructor and Description |
|---|
DefaultRelatedItemsCollector() |
| Modifier and Type | Method and Description |
|---|---|
<T extends ItemModel> |
collect(T theSource,
ItemVisitor<T> theStrategy,
Map<String,Object> ctx)
Travers given
theSource item against given ItemVisitor and returns all collected relatives. |
<T extends ItemModel> |
collect(T theSource,
Map<String,Object> ctx)
Travers given
theSource item against best matching ItemVisitor and returns all collected
relatives. |
protected void |
collectInternal(ItemModel theSource,
List<ItemModel> collected,
Map<String,Object> ctx,
int currentDepth) |
protected int |
extractMaxRecursionDepth(Map<String,Object> ctx) |
void |
setItemVisitorRegistry(ItemVisitorRegistry itemVisitorRegistry) |
public <T extends ItemModel> List<ItemModel> collect(T theSource, Map<String,Object> ctx)
RelatedItemsCollectortheSource item against best matching ItemVisitor and returns all collected
relatives.
Note: collect in interface RelatedItemsCollectorT - specific model class derived from ItemModeltheSource - given itemctx - ctx given contexttheSource itempublic <T extends ItemModel> List<ItemModel> collect(T theSource, ItemVisitor<T> theStrategy, Map<String,Object> ctx)
RelatedItemsCollectortheSource item against given ItemVisitor and returns all collected relatives.collect in interface RelatedItemsCollectorT - theSource - given itemtheStrategy - given ItemVisitorctx - given contexttheSource item and given theStrategyprotected void collectInternal(ItemModel theSource, List<ItemModel> collected, Map<String,Object> ctx, int currentDepth)
public void setItemVisitorRegistry(ItemVisitorRegistry itemVisitorRegistry)
Copyright © 2017 SAP SE. All Rights Reserved.