summaryrefslogtreecommitdiffstats
path: root/tutorial/tutorial.html
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2003-07-11 06:24:57 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2003-07-11 06:24:57 +0000
commitf6c16db268e47c2202f6098f4fae5a4537238857 (patch)
tree016cd632c56ad01120f54dd7052bfa31d54a2ada /tutorial/tutorial.html
parentabef4b9fb6d0490c8a8f41d976133239228f679e (diff)
downloadjavassist-f6c16db268e47c2202f6098f4fae5a4537238857.tar.gz
javassist-f6c16db268e47c2202f6098f4fae5a4537238857.zip
added ClassPool#removeCached so that subclasses of ClassPool can do
their own caching. A bug in CtClassType#setName was fixed. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@29 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'tutorial/tutorial.html')
-rw-r--r--tutorial/tutorial.html20
1 files changed, 16 insertions, 4 deletions
diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html
index 36104e30..d0a26e3b 100644
--- a/tutorial/tutorial.html
+++ b/tutorial/tutorial.html
@@ -34,9 +34,10 @@ Shigeru Chiba
Java bytecode is stored in a binary file called a class file.
Each class file contains one Java class or interface.
-<p>The class <code>Javassist.CtClass</code> is an abstract representation
-of a class file. A <code>CtClass</code> object is a handle for dealing
-with a class file. The following program is a very simple example:
+<p>The class <code>Javassist.CtClass</code> is an abstract
+representation of a class file. A <code>CtClass</code> (compile-time
+class) object is a handle for dealing with a class file. The
+following program is a very simple example:
<ul><pre>
ClassPool pool = ClassPool.getDefault();
@@ -57,7 +58,18 @@ to a file or an output stream.
mapping between classes and <code>CtClass</code> objects. Javassist
never allows two distinct <code>CtClass</code> objects to represent
the same class. This is a crucial feature to consistent program
-transformaiton.
+transformaiton. If you need, however, you can deal with multiple
+instances of <code>ClassPool</code> at the same time. To create a new
+instance of <code>ClassPool</code>, write the following code:
+
+<ul><pre>
+ClassPool cp = new ClassPool(null);
+cp.appendSystemPath();
+cp.insertClassPath("."); // or something appropriate
+</pre></ul>
+
+<p><code>ClassPool.getDefault()</code> is just a singleton factory
+method provided for convenience.
<p>To modify the definition of a class, the users must first obtain a
reference to the <code>CtClass</code> object representing that class.