| 1 19 20 25 26 package soot.tagkit; 27 import soot.*; 28 29 30 import java.util.*; 31 import javax.swing.*; 32 import java.io.*; 33 34 35 public class TagManager 36 { 37 public TagManager( Singletons.Global g ) {} 38 public static TagManager v() { return G.v().soot_tagkit_TagManager(); } 39 private TagPrinter tagPrinter = new StdTagPrinter(); 40 41 44 public Tag getTagFor(String tagName) { 45 try { 46 Class cc = Class.forName("soot.tagkit." + tagName); 47 return (Tag) cc.newInstance(); 48 } 49 catch (ClassNotFoundException e) { 50 return null; 51 } catch(IllegalAccessException e) { 52 throw new RuntimeException (); 53 } catch (InstantiationException e) { 54 throw new RuntimeException (e.toString()); 55 } 56 } 57 58 59 public void setTagPrinter(TagPrinter p) 60 { 61 tagPrinter = p; 62 } 63 64 65 public String print(String aClassName, String aFieldOrMtdSignature, 66 Tag aTag) 67 { 68 return tagPrinter.print(aClassName, aFieldOrMtdSignature, aTag); 69 } 70 } 71 72 73 74 | Popular Tags |