Package net.sf.cglib.samples
Class Beans
- java.lang.Object
-
- net.sf.cglib.samples.Beans
-
- All Implemented Interfaces:
Callback
,MethodInterceptor
public class Beans extends java.lang.Object implements MethodInterceptor
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.Class[]
C
(package private) static java.lang.Object[]
emptyArgs
private java.beans.PropertyChangeSupport
propertySupport
-
Constructor Summary
Constructors Constructor Description Beans()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
java.lang.Object
intercept(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, MethodProxy proxy)
All generated proxied methods call this method instead of the original method.static void
main(java.lang.String[] args)
static java.lang.Object
newInstance(java.lang.Class clazz)
void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
-
-
-
Method Detail
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
-
newInstance
public static java.lang.Object newInstance(java.lang.Class clazz)
-
intercept
public java.lang.Object intercept(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, MethodProxy proxy) throws java.lang.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 interfaceMethodInterceptor
- Parameters:
obj
- "this", the enhanced objectmethod
- intercepted Methodargs
- argument array; primitive types are wrappedproxy
- 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:
java.lang.Throwable
- any exception may be thrown; if so, super method will not be invoked- See Also:
MethodProxy
-
main
public static void main(java.lang.String[] args)
-
-