aboutsummaryrefslogtreecommitdiffstats
path: root/tutorial
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2005-11-08 10:45:41 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2005-11-08 10:45:41 +0000
commit5ff19d5945cda4b3d554e79d726e8a19de9c5766 (patch)
tree9ca1aec6600b1f4eedfbcac5aa031d6c9f49bbe5 /tutorial
parent65e6ac84216e2e4e0deeef70602b50d9a9b62c6c (diff)
downloadjavassist-5ff19d5945cda4b3d554e79d726e8a19de9c5766.tar.gz
javassist-5ff19d5945cda4b3d554e79d726e8a19de9c5766.zip
appended ClassPool(boolean) constructor.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@220 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'tutorial')
-rw-r--r--tutorial/tutorial.html20
1 files changed, 14 insertions, 6 deletions
diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html
index 9644016a..f3766d43 100644
--- a/tutorial/tutorial.html
+++ b/tutorial/tutorial.html
@@ -35,7 +35,7 @@ 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
+<p>The class <code>Javassist.CtClass</code> is an absatract
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:
@@ -338,8 +338,8 @@ To create a new instance of <code>ClassPool</code>, execute the following
code snippet:
<ul><pre>
-ClassPool cp = new ClassPool();
-cp.appendSystemPath(); // or append another path by appendClassPath()
+ClassPool cp = new ClassPool(true);
+// if needed, append an extra search path by appendClassPath()
</pre></ul>
<p>This creates a <code>ClassPool</code> object that behaves as the
@@ -353,8 +353,17 @@ A <code>ClassPool</code> object returned by <code>getDefault()</code>
does not have a special role. <code>getDefault()</code> is a convenience
method.
+<p>Note that <code>new ClassPool(true)</code> is a convenient constructor,
+which constructs a <code>ClassPool</code> object and appends the system
+search path to it. Calling that constructor is
+equivalent to the following code:
+
+<ul><pre>
+ClassPool cp = new ClassPool();
+cp.appendSystemPath(); // or append another path by appendClassPath()
+</pre></ul>
-<h4>Cascaded ClassPools.</h4>
+<h4>Cascaded ClassPools</h4>
<p>
<em>If a program is running on a web application server,</em>
@@ -460,8 +469,7 @@ transformation.
snippet (this code was already <a href="#avoidmemory">shown above</a>):
<ul><pre>
-ClassPool cp = new ClassPool();
-cp.appendSystemPath(); // or append another path by appendClassPath()
+ClassPool cp = new ClassPool(true);
</pre></ul>
<p>If you have two <code>ClassPool</code> objects, then you can