1 16 17 package de.gulden.util.javasource; 18 19 import de.gulden.util.xml.XMLToolbox; 20 import javax.xml.parsers.*; 21 import org.w3c.dom.*; 22 import java.io.*; 23 import java.util.*; 24 25 31 public class ImportPackage extends Import { 32 33 39 public ImportPackage(Package parent) { 40 super(parent); 41 } 42 43 46 ImportPackage(Package parent, String name) { 47 this(parent); 48 setName(name); 49 } 50 51 52 60 public String qualify(String name) { 61 String testname=getName(); testname=testname.substring(0,testname.length()-1); testname=testname+name; 64 65 Class c=getPackage().getBasePackage().findClass(testname); 67 if (c!=null) { 68 return testname; 69 } 70 71 try { 73 java.lang.Class.forName(testname); 74 return testname; 75 } 76 catch (ClassNotFoundException e) { 77 return null; 78 } 79 } 80 81 87 public Element buildXML(Document d) { 88 Element e=super.buildXML(d); 89 e.setAttribute("kind","package"); 90 return e; 91 } 92 93 } | Popular Tags |