/** * Creates a class pool. * * @param parent the parent of this class pool. If this is a root * class pool, this parameter must be <code>null</code>. * @see javassist.ClassPool#getDefault() */ public ClassPool(ClassPool parent) { this.classes = new Hashtable(INIT_HASH_SIZE); this.source = new ClassPoolTail(); this.parent = parent; if (parent == null) { CtClass[] pt = CtClass.primitiveTypes; for (int i = 0; i < pt.length; ++i) classes.put(pt[i].getName(), pt[i]); } this.cflow = null; this.compressCount = 0; clearImportedPackages(); }
public ClassPath appendClassPath(String pathname) throws NotFoundException { return appendClassPath(makePathObject(pathname)); }
/** * Appends the system search path to the end of the * search path. The system search path * usually includes the platform library, extension * libraries, and the search path specified by the * <code>-classpath</code> option or the <code>CLASSPATH</code> * environment variable. * * @return the appended class path. */ public ClassPath appendSystemPath() { return source.appendSystemPath(); }
public ClassPath insertClassPath(String pathname) throws NotFoundException { return insertClassPath(makePathObject(pathname)); }
/** * This method does not close the output stream. */ void writeClassfile(String classname, OutputStream out) throws NotFoundException, IOException, CannotCompileException { InputStream fin = openClassfile(classname); if (fin == null) throw new NotFoundException(classname); try { copyStream(fin, out); } finally { fin.close(); } }
/** * Appends a <code>ClassPath</code> object to the end of the * search path. * * @return the appended class path. * @see javassist.ClassPath * @see javassist.URLClassPath * @see javassist.ByteArrayClassPath */ public ClassPath appendClassPath(ClassPath cp) { return source.appendClassPath(cp); }
/** * Insert a <code>ClassPath</code> object at the head of the * search path. * * @return the inserted class path. * @see javassist.ClassPath * @see javassist.URLClassPath * @see javassist.ByteArrayClassPath */ public ClassPath insertClassPath(ClassPath cp) { return source.insertClassPath(cp); }
try { if (size <= 0) b = ClassPoolTail.readStream(s); else { b = new byte[size];
/** * Searches the class path to obtain the URL of the class file * specified by classname. It is also used to determine whether * the class file exists. * * @param classname a fully-qualified class name. * @return null if the class file could not be found. * @see CtClass#getURL() */ public URL find(String classname) { return source.find(classname); }
/** * Detatches the <code>ClassPath</code> object from the search path. * The detached <code>ClassPath</code> object cannot be added * to the path again. */ public void removeClassPath(ClassPath cp) { source.removeClassPath(cp); }
InputStream openClassfile(String classname) throws NotFoundException { return source.openClassfile(classname); }
public ClassPath insertClassPath(String pathname) throws NotFoundException { return insertClassPath(makePathObject(pathname)); }
/** * This method does not close the output stream. */ void writeClassfile(String classname, OutputStream out) throws NotFoundException, IOException, CannotCompileException { InputStream fin = openClassfile(classname); if (fin == null) throw new NotFoundException(classname); try { copyStream(fin, out); } finally { fin.close(); } }
/** * Appends a directory or a jar (or zip) file to the end of the * search path. * * @param pathname the path name of the directory or jar file. * It must not end with a path separator ("/"). * If the path name ends with "/*", then all the * jar files matching the path name are appended. * * @return the appended class path. * @throws NotFoundException if the jar file is not found. */ public ClassPath appendClassPath(String pathname) throws NotFoundException { return source.appendClassPath(pathname); }
/** * Inserts a directory or a jar (or zip) file at the head of the * search path. * * @param pathname the path name of the directory or jar file. * It must not end with a path separator ("/"). * If the path name ends with "/*", then all the * jar files matching the path name are inserted. * * @return the inserted class path. * @throws NotFoundException if the jar file is not found. */ public ClassPath insertClassPath(String pathname) throws NotFoundException { return source.insertClassPath(pathname); }
try { if (size <= 0) b = ClassPoolTail.readStream(s); else { b = new byte[size];
/** * Searches the class path to obtain the URL of the class file * specified by classname. It is also used to determine whether * the class file exists. * * @param classname a fully-qualified class name. * @return null if the class file could not be found. * @see CtClass#getURL() */ public URL find(String classname) { return source.find(classname); }
/** * Detatches the <code>ClassPath</code> object from the search path. * The detached <code>ClassPath</code> object cannot be added * to the path again. */ public void removeClassPath(ClassPath cp) { source.removeClassPath(cp); }
InputStream openClassfile(String classname) throws NotFoundException { return source.openClassfile(classname); }
public ClassPath insertClassPath(String pathname) throws NotFoundException { return insertClassPath(makePathObject(pathname)); }