private void refresh() { this.evict(); this.needRefresh = Boolean.FALSE; FormationCompositeDomain rootDomain = repository.findRoot(); if (rootDomain == null) { return; } FormationComposite rootModel = rootDomain.toModel(); this.rootId = rootModel.getId(); this.components.put(rootModel.getId(), rootModel); this.visitor.crawlFromRoot(rootModel); }
final void crawlFromRoot(FormationComposite root) { for (FormationComponent component : root.getFormations()) { if (component.isLeaf()) { this.onLeafFound((FormationLeaf) component); } else { FormationComposite composite = (FormationComposite) component; this.onCompositeFound(composite); this.crawlFromRoot(composite); } } }