1 19 package org.netbeans.modules.xml.retriever.catalog.model; 20 21 public interface CatalogVisitor { 22 23 void visit(Catalog component); 24 void visit(System system); 25 void visit(NextCatalog nextCatalog); 26 29 public static class Default implements CatalogVisitor { 30 31 public void visit(Catalog component) { 32 visitChild(); 33 } 34 35 protected void visitChild() { 36 } 37 38 public void visit(System system) { 39 } 40 41 public void visit(NextCatalog nextCatalog) { 42 } 43 } 44 45 48 public static class Deep extends Default { 49 protected void visitChild(CatalogComponent component) { 50 for (CatalogComponent child : component.getChildren()) { 51 child.accept(this); 52 } 53 } 54 } 55 } 56 | Popular Tags |