org.siebengeisslein.persistent
Class PWrapper

java.lang.Object
  extended by org.siebengeisslein.persistent.PWrapper
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class PWrapper
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Because Persistent objects can be expired and may not be used afterwards, All references passed to swing objects (listeners/models) have to be wrapped using this class. This way always the newest version of the object is retrieved before invoking a method on it.


Method Summary
 Persistent getWrapped()
           
static java.lang.Object getWrapped(java.lang.Object value)
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
static
<A> boolean
isDifferent(A newValue, A oldValue)
           
static boolean isEquals(java.lang.reflect.Method method)
           
static
<A> A
wrap(java.lang.Class<A> interfaceClass, A delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWrapped

public Persistent getWrapped()

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

isEquals

public static boolean isEquals(java.lang.reflect.Method method)

wrap

public static <A> A wrap(java.lang.Class<A> interfaceClass,
                         A delegate)

isDifferent

public static <A> boolean isDifferent(A newValue,
                                      A oldValue)

getWrapped

public static java.lang.Object getWrapped(java.lang.Object value)