Class Trace

java.lang.Object
net.sf.cglib.samples.Trace
All Implemented Interfaces:
Callback, MethodInterceptor

public class Trace extends Object implements MethodInterceptor
  • Field Details

    • ident

      int ident
    • callback

      static Trace callback
  • Constructor Details

    • Trace

      private Trace()
      Creates a new instance of Trace
  • Method Details

    • newInstance

      public static Object newInstance(Class clazz)
    • main

      public static void main(String[] args)
      Parameters:
      args - the command line arguments
    • intercept

      public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable
      Description copied from interface: MethodInterceptor
      All generated proxied methods call this method instead of the original method. The original method may either be invoked by normal reflection using the Method object, or by using the MethodProxy (faster).
      Specified by:
      intercept in interface MethodInterceptor
      Parameters:
      obj - "this", the enhanced object
      method - intercepted Method
      args - argument array; primitive types are wrapped
      proxy - used to invoke super (non-intercepted method); may be called as many times as needed
      Returns:
      any value compatible with the signature of the proxied method. Method returning void will ignore this value.
      Throws:
      Throwable - any exception may be thrown; if so, super method will not be invoked
      See Also:
    • printIdent

      void printIdent(int ident)