From aa92b8250ecf9bb0698a0844123b67a5f2ac5279 Mon Sep 17 00:00:00 2001 From: chiba Date: Mon, 19 Jul 2004 12:02:27 +0000 Subject: Bugs item #988787 has been fixed. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@114 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- tutorial/tutorial.html | 19 ++++++++++++++----- tutorial/tutorial3.html | 8 +++++++- 2 files changed, 21 insertions(+), 6 deletions(-) (limited to 'tutorial') diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html index 0598f60b..52a68e1c 100644 --- a/tutorial/tutorial.html +++ b/tutorial/tutorial.html @@ -400,6 +400,15 @@ program by a user-defined class loader. The latter one, as well as the program of the user-defined class loader, should be loaded by the system class loader. + +


4.1 Class loading in Java

@@ -589,15 +598,15 @@ The event-listener class must implement the following interface:

The method start() is called when this event listener is added to a javassist.Loader object by addTranslator() in javassist.Loader. The -method onWrite() is called before -javassist.Loader loads a class. onWrite() +method onLoad() is called before +javassist.Loader loads a class. onLoad() can modify the definition of the loaded class.

For example, the following event listener changes all classes @@ -606,7 +615,7 @@ to public classes just before they are loaded.

-

Note that onWrite() does not have to call +

Note that onLoad() does not have to call toBytecode() or writeFile() since javassist.Loader calls these methods to obtain a class file. diff --git a/tutorial/tutorial3.html b/tutorial/tutorial3.html index 4b732978..c965a64c 100644 --- a/tutorial/tutorial3.html +++ b/tutorial/tutorial3.html @@ -84,10 +84,16 @@ In other words, a FieldInfo (or MethodInfo etc.) objec must not be shared among different ClassFile objects.

-To remove a field or a method, you must first obtain a java.util.List +To remove a field or a method, +you must first obtain a java.util.List object containing all the fields of the class. getFields() and getMethods() return the lists. A field or a method can be removed by calling remove() on the List object. +An attribute can be removed in a similar way. +Call getAttributes() in FieldInfo or +MethodInfo to obtain the list of attributes, +and remove one from the list. +


-- cgit v1.2.3