| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectclassUtils.javassist.reflect.Metaobject
classUtils.javassist.sample.duplicate.DuplicatedObject
public class DuplicatedObject
| Constructor Summary | |
|---|---|
| DuplicatedObject(java.lang.Object self,
                 java.lang.Object[] args) | |
| Method Summary | |
|---|---|
|  java.lang.Object | trapMethodcall(int identifier,
               java.lang.Object[] args)Is invoked when base-level method invocation is intercepted. | 
| Methods inherited from class classUtils.javassist.reflect.Metaobject | 
|---|
| getClassMetaobject, getMethodName, getObject, getParameterTypes, getReturnType, setObject, trapFieldRead, trapFieldWrite | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public DuplicatedObject(java.lang.Object self,
                        java.lang.Object[] args)
| Method Detail | 
|---|
public java.lang.Object trapMethodcall(int identifier,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
MetaobjectEvery subclass of this class should redefine this method.
Note: this method is not invoked if the base-level method is invoked by a constructor in the super class. For example,
abstract class A {
   abstract void initialize();
   A() {
       initialize();    // not intercepted
   }
 }
 class B extends A {
   void initialize() { System.out.println("initialize()"); }
   B() {
       super();
       initialize();    // intercepted
   }
 }
 if an instance of B is created, the invocation of initialize() in B is intercepted only once. The first invocation by the constructor in A is not intercepted. This is because the link between a base-level object and a metaobject is not created until the execution of a constructor of the super class finishes.
trapMethodcall in class Metaobjectjava.lang.Throwable| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||