1 18 19 package org.objectweb.jac.ide; 20 21 import java.io.IOException ; 22 import java.io.Writer ; 23 import java.util.Iterator ; 24 25 28 29 public abstract class AbstractPlugin implements AspectPlugin { 30 AccGenState state; 31 32 public void genConfig(Writer output, Project project) 33 throws IOException 34 { 35 Iterator it = project.getPackages().iterator(); 36 while (it.hasNext()) { 37 Package pkg = (Package )it.next(); 38 genPackageConfig(output,project,pkg); 39 } 40 } 41 42 45 public void genPackageConfig(Writer output, 46 Project project, Package pkg) 47 throws IOException 48 { 49 Iterator it = pkg.getSubPackages().iterator(); 50 while (it.hasNext()) { 51 Package subPkg = (Package )it.next(); 52 genPackageConfig(output,project,subPkg); 53 } 54 it = pkg.getClasses().iterator(); 55 while (it.hasNext()) { 56 Class cl = (Class )it.next(); 57 if (!(cl instanceof Interface)) { 58 state = new AccGenState(output); 59 genClassConfig(output,project,pkg,cl); 60 state.closeClass(); 61 } 62 } 63 } 64 65 68 public void genClassConfig(Writer output, 69 Project project, Package pkg, Class cl) 70 throws IOException 71 { 72 Iterator it = cl.getFields().iterator(); 73 while (it.hasNext()) { 74 Field field = (Field)it.next(); 75 genFieldConfig(output,project,pkg,cl,field); 76 state.closeMember(); 77 } 78 79 it = cl.getMethods().iterator(); 80 while (it.hasNext()) { 81 Method method = (Method)it.next(); 82 genMethodConfig(output,project,pkg,cl,method); 83 state.closeMember(); 84 } 85 86 it = cl.getRelationRoles().iterator(); 87 while (it.hasNext()) { 88 RelationRole role = (RelationRole)it.next(); 89 genRoleConfig(output,project,pkg,cl,role); 90 state.closeMember(); 91 } 92 } 93 94 97 public void genFieldConfig(Writer output, Project project, 98 Package pkg, Class cl, Field field) 99 throws IOException 100 {} 101 102 105 public void genMethodConfig(Writer output, Project project, 106 Package pkg, Class cl, Method method) 107 throws IOException 108 {} 109 110 111 114 public void genRoleConfig(Writer output, Project project, 115 Package pkg, Class cl, RelationRole role) 116 throws IOException 117 {} 118 } 119 | Popular Tags |