/** * Creates a CtClass object representing the specified class. * It first examines whether or not the corresponding class * file exists. If yes, it creates a CtClass object. * * @return null if the class file could not be found. */ protected CtClass createCtClass(String classname, boolean useCache) { // accept "[L<class name>;" as a class name. if (classname.charAt(0) == '[') classname = Descriptor.toClassName(classname); if (classname.endsWith("[]")) { String base = classname.substring(0, classname.indexOf('[')); if ((!useCache || getCached(base) == null) && find(base) == null) return null; else return new CtArray(classname, this); } else if (find(classname) == null) return null; else return new CtClassType(classname, this); }
public URL getURL() throws NotFoundException { URL url = classPool.find(getName()); if (url == null) throw new NotFoundException(getName()); else return url; }