This content has been marked as final.
Show 3 replies
-
1. Re: Can Javassit capture JDK lib method call like JLabel.set
chiba Aug 21, 2004 11:46 AM (in response to sjtuzl)Please set javassist.Loader.doDelegation to false
at the beginning.
Or, download the latest snapshot from the
CVS and try toClass(). -
2. Re: Can Javassit capture JDK lib method call like JLabel.set
sjtuzl Aug 21, 2004 2:50 PM (in response to sjtuzl)Thank you for the response. My intention is not modify Swing lib, but to capture the call of J**.setText() in user code. For example;
public MyClass test {
public static void main (String[] args){
JLable jLabel = new javax.swing.JLabel();
//Need to add a methd before it
jLabel.setText("test");
//Need to add a method after it
...
I need to apply above insert (before and after) operation for all Jxx.SetText() call, where Jxx is JLabel, JText, etc..
Is it possible for Javassit? Thanks -
3. Re: Can Javassit capture JDK lib method call like JLabel.set
chiba Aug 21, 2004 11:08 PM (in response to sjtuzl)You can use CtClass.instrument(ExprEditor) for inserting
some expression before a method call to
Jxx.setText().
Is this what you need?