| 1 20 21 package com.tonicsystems.jarjar; 22 23 import com.tonicsystems.jarjar.util.*; 24 import java.io.*; 25 import java.util.*; 26 27 abstract public class AbstractDepHandler implements DepHandler 28 { 29 protected int level; 30 private Set seenIt = new HashSet(); 31 32 protected AbstractDepHandler(int level) { 33 this.level = level; 34 } 35 36 public void handle(PathClass from, PathClass to) throws IOException { 37 Pair pair; 38 if (level == LEVEL_JAR) { 39 pair = new Pair(from.getClassPath(), to.getClassPath()); 40 } else { 41 pair = new Pair(from.getClassName(), to.getClassName()); 42 } 43 if (!seenIt.contains(pair)) { 44 seenIt.add(pair); 45 handle((String )pair.getObject1(), (String )pair.getObject2()); 46 } 47 } 48 49 abstract protected void handle(String from, String to) throws IOException; 50 51 public void handleStart() throws IOException { } 52 public void handleEnd() throws IOException { } 53 } 54 55 56 | Popular Tags |