1 32 33 package com.jeantessier.dependency; 34 35 import java.util.*; 36 37 public class ClosureStartSelector extends ClosureSelector { 38 private SelectionCriteria criteria; 39 40 public ClosureStartSelector(NodeFactory factory, SelectionCriteria criteria) { 41 super(factory); 42 43 this.criteria = criteria; 44 } 45 46 public void visitPackageNode(PackageNode node) { 47 if (criteria.matches(node)) { 48 getSelectedNodes().add(node); 49 getCopiedNodes().add(getFactory().createPackage(node.getName(), node.isConfirmed())); 50 } 51 52 traverseNodes(node.getClasses()); 53 } 54 55 public void visitInboundPackageNode(PackageNode node) { 56 } 58 59 public void visitOutboundPackageNode(PackageNode node) { 60 } 62 63 public void visitClassNode(ClassNode node) { 64 if (criteria.matches(node)) { 65 getSelectedNodes().add(node); 66 getCopiedNodes().add(getFactory().createClass(node.getName(), node.isConfirmed())); 67 } 68 69 traverseNodes(node.getFeatures()); 70 } 71 72 public void visitInboundClassNode(ClassNode node) { 73 } 75 76 public void visitOutboundClassNode(ClassNode node) { 77 } 79 80 public void visitFeatureNode(FeatureNode node) { 81 if (criteria.matches(node)) { 82 getSelectedNodes().add(node); 83 getCopiedNodes().add(getFactory().createFeature(node.getName(), node.isConfirmed())); 84 } 85 } 86 87 public void visitInboundFeatureNode(FeatureNode node) { 88 } 90 91 public void visitOutboundFeatureNode(FeatureNode node) { 92 } 94 } 95 | Popular Tags |