/** * Returns a PropertyProxy suitable for the given instance and registers * the selected PropertyProxy for the Class of the instance. Note that * the PropertyProxy is not cloned so either the PropertyProxy should be * used as a template else you must first call clone() on the returned * PropertyProxy and then set the instance as the default on the resulting * clone. * * @param instance the type to search for a suitable PropertyProxy. * @return PropertyProxy suitable for the instance type. */ public static PropertyProxy getProxyAndRegister(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxyAndRegister(c); if (proxy == null) { proxy = guessProxy(instance); getRegistry().register(c, proxy); } return proxy; }
/** * Returns a PropertyProxy suitable for the given instance and registers * the selected PropertyProxy for the Class of the instance. Note that * the PropertyProxy is not cloned so either the PropertyProxy should be * used as a template else you must first call clone() on the returned * PropertyProxy and then set the instance as the default on the resulting * clone. * * @param instance the type to search for a suitable PropertyProxy. * @return PropertyProxy suitable for the instance type. */ public static PropertyProxy getProxyAndRegister(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxyAndRegister(c); if (proxy == null) { proxy = guessProxy(instance); getRegistry().register(c, proxy); } return proxy; }
/** * Returns a PropertyProxy suitable for the given instance and registers * the selected PropertyProxy for the Class of the instance. Note that * the PropertyProxy is not cloned so either the PropertyProxy should be * used as a template else you must first call clone() on the returned * PropertyProxy and then set the instance as the default on the resulting * clone. * * @param instance the type to search for a suitable PropertyProxy. * @return PropertyProxy suitable for the instance type. */ public static PropertyProxy getProxyAndRegister(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxyAndRegister(c); if (proxy == null) { proxy = guessProxy(instance); getRegistry().register(c, proxy); } return proxy; }
protected Object decodeTypedObject(Object bean, Object encodedObject) PropertyProxy beanProxy = PropertyProxyRegistry.getProxyAndRegister(bean); PropertyProxy encodedProxy = PropertyProxyRegistry.getProxyAndRegister(encodedObject);
pp = PropertyProxyRegistry.getProxyAndRegister(newInst); instance = newInst;
protected Object decodeTypedObject(Object bean, Object encodedObject) PropertyProxy beanProxy = PropertyProxyRegistry.getProxyAndRegister(bean); PropertyProxy encodedProxy = PropertyProxyRegistry.getProxyAndRegister(encodedObject);
protected Object decodeTypedObject(Object bean, Object encodedObject) PropertyProxy beanProxy = PropertyProxyRegistry.getProxyAndRegister(bean); PropertyProxy encodedProxy = PropertyProxyRegistry.getProxyAndRegister(encodedObject);
pp = PropertyProxyRegistry.getProxyAndRegister(newInst); instance = newInst;
proxy = PropertyProxyRegistry.getProxyAndRegister(newInst); instance = newInst;
pp = PropertyProxyRegistry.getProxyAndRegister(newInst); instance = newInst;
private Object getInstantiatedObject(String className, PropertyProxy proxy) { Class<?> desiredClass = null; try { desiredClass = AbstractProxy.getClassFromClassName(className); } catch (MessageException me) { // Type not found but don't mind using ASObject for the missing type. if (me.getCode().startsWith(MessageException.CODE_SERVER_RESOURCE_UNAVAILABLE) && context.createASObjectForMissingType) { ASObject object = (ASObject)ClassUtil.createDefaultInstance(ASObject.class, null, true /*validate*/); object.setType(className); return object; } throw me; // Rethrow. } // Type exists. proxy = PropertyProxyRegistry.getRegistry().getProxyAndRegister(desiredClass); return proxy == null? ClassUtil.createDefaultInstance(desiredClass, null, true /*validate*/) : proxy.createInstance(className); // Validation is performed in the proxy. }
private Object getInstantiatedObject(String className, PropertyProxy proxy) { Class<?> desiredClass = null; try { desiredClass = AbstractProxy.getClassFromClassName(className); } catch (MessageException me) { // Type not found but don't mind using ASObject for the missing type. if (me.getCode().startsWith(MessageException.CODE_SERVER_RESOURCE_UNAVAILABLE) && context.createASObjectForMissingType) { ASObject object = (ASObject)ClassUtil.createDefaultInstance(ASObject.class, null, true /*validate*/); object.setType(className); return object; } throw me; // Rethrow. } // Type exists. proxy = PropertyProxyRegistry.getRegistry().getProxyAndRegister(desiredClass); return proxy == null? ClassUtil.createDefaultInstance(desiredClass, null, true /*validate*/) : proxy.createInstance(className); // Validation is performed in the proxy. }
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);
proxy = PropertyProxyRegistry.getProxyAndRegister(o);