net.sf.cglib
Class BeforeAfterAdapter

java.lang.Object
  extended by net.sf.cglib.BeforeAfterInterceptor
      extended by net.sf.cglib.BeforeAfterAdapter
All Implemented Interfaces:
MethodInterceptor

public class BeforeAfterAdapter
extends BeforeAfterInterceptor

A concrete implementation of BeforeAfterInterceptor that does nothing except call the original method. For extension by implementors who want to only override either invokeSuper or afterReturn.

Version:
$Id: BeforeAfterAdapter.java,v 1.4 2003/05/13 06:17:09 herbyderby Exp $

Constructor Summary
BeforeAfterAdapter()
           
 
Method Summary
 java.lang.Object afterReturn(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, boolean invokedSuper, java.lang.Object retValFromSuper, java.lang.Throwable e)
          This method is called after invoking the super (non-intercepted) method, or directly after the invokeSuper interceptor method, if it returned false.
 boolean invokeSuper(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args)
          This method is called before invoking the super (non-intercepted) method.
 
Methods inherited from class net.sf.cglib.BeforeAfterInterceptor
intercept
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeforeAfterAdapter

public BeforeAfterAdapter()
Method Detail

invokeSuper

public boolean invokeSuper(java.lang.Object obj,
                           java.lang.reflect.Method method,
                           java.lang.Object[] args)
                    throws java.lang.Throwable
Description copied from class: BeforeAfterInterceptor
This method is called before invoking the super (non-intercepted) method.

Specified by:
invokeSuper in class BeforeAfterInterceptor
Parameters:
obj - "this", the enhanced object
method - intercepted Method
args - argument array; primitive types are wrapped
Returns:
true
Throws:
java.lang.Throwable - any exception may be thrown; super method will not be invoked

afterReturn

public java.lang.Object afterReturn(java.lang.Object obj,
                                    java.lang.reflect.Method method,
                                    java.lang.Object[] args,
                                    boolean invokedSuper,
                                    java.lang.Object retValFromSuper,
                                    java.lang.Throwable e)
                             throws java.lang.Throwable
Description copied from class: BeforeAfterInterceptor
This method is called after invoking the super (non-intercepted) method, or directly after the invokeSuper interceptor method, if it returned false.

Specified by:
afterReturn in class BeforeAfterInterceptor
Parameters:
obj - "this", the enhanced object
method - intercepted Method
args - argument array; primitive types are wrapped
invokedSuper - whether the super method was invoked
retValFromSuper - value returned from super (unless there was an exception)
e - Throwable thrown by the super method (if any)
Returns:
the supplied retValFromSuper (original method return value)
Throws:
java.lang.Throwable - any exception may be thrown


Copyright (c) 2001 - Apache Software Foundation