* @see javassist.ClassPath
* @see ClassPool#insertClassPath(ClassPath)
* @see ClassPool#appendClassPath(ClassPath)
+ * @see ClassPool#makeClass(InputStream)
*/
public class ByteArrayClassPath implements ClassPath {
protected String classname;
* @param classfile class file.
* @exception RuntimeException if there is a frozen class with the
* the same name.
+ * @see javassist.ByteArrayClassPath
*/
public CtClass makeClass(InputStream classfile)
throws IOException, RuntimeException
/**
* Obtains exceptions that this method/constructor may throw.
+ *
+ * @return a zero-length array if there is no throws clause.
*/
public CtClass[] getExceptionTypes() throws NotFoundException {
String[] exceptions;
*/
public void setExceptionTypes(CtClass[] types) throws NotFoundException {
declaringClass.checkModify();
- if (types == null) {
+ if (types == null || types.length == 0) {
methodInfo.removeExceptionsAttribute();
return;
}
/**
* Prints the version number and the copyright notice.
+ *
+ * <p>The following command invokes this method:
+ *
+ * <ul><pre>java -jar javassist.jar</pre></ul>
*/
public static void main(String[] args) {
System.out.println("Javassist version " + CtClass.version);
<body>
The Javassist Core API.
-<p>Javassist (<i>Java</i> programming <i>assist</i>ant) is yet another
-reflective system for Java. It is a class library for editing
+<p>Javassist (<i>Java</i> programming <i>assist</i>ant) makes bytecode
+engineering simple. It is a class library for editing
bytecode in Java; it enables Java programs to define a new class at
runtime and to modify a given class file when the JVM loads it.
<p>The most significant class of this package is <code>CtClass</code>.
See the description of this class first.
+<p>To know the version number of this package, type the following command:
+
+<ul><pre>
+java -jar javassist.jar
+</pre></ul>
+
+<p>It prints the version number on the console.
+
</body>
</html>