[jboss-user] [Javassist] New message: "How can I redirect field access to a method call?"
xeo show
do-not-reply at jboss.com
Sat Mar 13 00:58:08 EST 2010
User development,
A new message was posted in the thread "How can I redirect field access to a method call?":
http://community.jboss.org/message/531784#531784
Author : xeo show
Profile : http://community.jboss.org/people/xeoshow
Message:
--------------------------------------------------------------
Hello,
I am new to Javassist, I found below existing API:
--------------------
| void | *http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CodeConverter.html#redirectFieldAccess%28javassist.CtField,%20javassist.CtClass,%20java.lang.String%29*(http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CtField.html field, http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CtClass.html newClass, java.lang.String newFieldname)
Modify a method body so that field read/write expressions access a different field from the original one. |
|
|
| void | *http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CodeConverter.html#replaceFieldRead%28javassist.CtField,%20javassist.CtClass,%20java.lang.String%29*(http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CtField.html field, http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CtClass.html calledClass, java.lang.String calledMethod)
Modify a method body so that an expression reading the specified field is replaced with a call to the specified +static+ method. |
| void | *http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CodeConverter.html#replaceFieldWrite%28javassist.CtField,%20javassist.CtClass,%20java.lang.String%29*(http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CtField.html field, http://www.csg.is.titech.ac.jp/%7Echiba/javassist/html/javassist/CtClass.html calledClass, java.lang.String calledMethod)
Modify a method body so that an expression writing the specified field is replaced with a call to the specified static method. |
--------------------
What I want is: When access a static field, it will be redirected to a method call, but from above APIs, seems do not have this function, could any one please help?
Thanks a lot.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/531784#531784
More information about the jboss-user
mailing list