1 package org.apache.beehive.controls.runtime.bean; 2 19 20 import java.beans.BeanInfo ; 21 import java.beans.DefaultPersistenceDelegate ; 22 import java.beans.Encoder ; 23 import java.beans.Expression ; 24 import java.beans.IntrospectionException ; 25 import java.beans.Introspector ; 26 import java.beans.PersistenceDelegate ; 27 import java.beans.PropertyDescriptor ; 28 import java.beans.Statement ; 29 import java.beans.XMLEncoder ; 30 import java.util.Set ; 31 32 import org.apache.beehive.controls.api.ControlException; 33 34 39 public class AdaptorPersistenceDelegate extends DefaultPersistenceDelegate 40 { 41 44 protected Expression instantiate(Object oldInstance, Encoder out) 45 { 46 if (! (oldInstance instanceof EventAdaptor)) 47 return super.instantiate(oldInstance, out); 48 49 return new Expression (oldInstance, oldInstance.getClass(), "new", 55 new Object [] { ((EventAdaptor)oldInstance).getClient() }); 56 } 57 58 61 protected void initialize(Class <?> type, Object oldInstance, Object newInstance, Encoder out) 62 { 63 super.initialize(type, oldInstance, newInstance, out); 64 } 65 66 69 public void writeObject(Object oldInstance, Encoder out) 70 { 71 super.writeObject(oldInstance, out); 72 } 73 } 74 | Popular Tags |