diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2012-06-17 15:01:27 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2012-06-17 15:01:27 +0000 |
commit | e2cfbeaed7be298c93251f6f9af480cdba84f68f (patch) | |
tree | 8b49af3c3a31cde77e252c5327900fbb0d628505 /tutorial/tutorial3.html | |
parent | 08deb0e6bc17f84f6bda03a29a7c2d3a8610a1ef (diff) | |
download | javassist-e2cfbeaed7be298c93251f6f9af480cdba84f68f.tar.gz javassist-e2cfbeaed7be298c93251f6f9af480cdba84f68f.zip |
implemented JASSIST-170
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@639 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'tutorial/tutorial3.html')
-rw-r--r-- | tutorial/tutorial3.html | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tutorial/tutorial3.html b/tutorial/tutorial3.html index e07372bd..7c505e0b 100644 --- a/tutorial/tutorial3.html +++ b/tutorial/tutorial3.html @@ -28,7 +28,9 @@ <p><a href="#j2me">8. J2ME</a> -<p><a href="#debug">9. Debug</a> +<p><a href="#boxing">9. Boxing/Unboxing + +<p><a href="#debug">10. Debug</a> <p><br> @@ -296,6 +298,11 @@ public Object get() { return value; } <p>Note that no type parameters are necessary. +<p>However, if you need to make type parameters accessible through reflection +during runtime, you have to add generic signatures to the class file. +For more details, see the API documentation (javadoc) of the +<code>setGenericSignature</code> method in the <code>CtClass</code>. + <p><br> <h2><a name="varargs">7. Varargs</a></h2> @@ -359,7 +366,26 @@ objects, call the <code>getDeclaredMethods</code> method on a <code>CtClass</cod <p><br> -<h2><a name="debug">9. Debug</h2> +<h2><a name="boxing">9. Boxing/Unboxing</h2> + +<p>Boxing and unboxing in Java are syntactic sugar. There is no bytecode for +boxing or unboxing. So the compiler of Javassist does not support them. +For example, the following statement is valid in Java: + +<ul><pre> +Integer i = 3; +</pre></ul> + +<p>since boxing is implicitly performed. For Javassist, however, you must explicitly +convert a value type from <code>int</code> to <code>Integer</code>: + +<ul><pre> +Integer i = new Integer(3); +</pre></ul> + +<p><br> + +<h2><a name="debug">10. Debug</h2> <p>Set <code>CtClass.debugDump</code> to a directory name. Then all class files modified and generated by Javassist are saved in that |