/** * Locates a custom PropertyProxy for the given Class. The entire class * hierarchy is searched. Even if a match is found in the class heirarchy * the PropertyProxy is not registered for the given Class. * * @param c the Class used to search the registry. * @return the custom PropertyProxy registered for the Class or * null if a PropertyProxy was not found or if the given Class is null. */ public PropertyProxy getProxy(Class c) { return getProxy(c, true, false); }
/** * Locates a custom PropertyProxy for the given Class. The entire class * hierarchy is searched. Even if a match is found in the class heirarchy * the PropertyProxy is not registered for the given Class. * * @param c the Class used to search the registry. * @return the custom PropertyProxy registered for the Class or * null if a PropertyProxy was not found or if the given Class is null. */ public PropertyProxy getProxy(Class c) { return getProxy(c, true, false); }
/** * Locates a custom PropertyProxy for the given Class. The entire class * hierarchy is searched. If a match is found in the class heirarchy the * PropertyProxy is registered for the given class. * * @param c the Class used to search the registry. * @return the custom PropertyProxy registered for the Class or * null if a PropertyProxy was not found or if the given Class is null. */ public PropertyProxy getProxyAndRegister(Class c) { return getProxy(c, true, true); }
/** * Locates a custom PropertyProxy for the given Class. The entire class * hierarchy is searched. Even if a match is found in the class heirarchy * the PropertyProxy is not registered for the given Class. * * @param c the Class used to search the registry. * @return the custom PropertyProxy registered for the Class or * null if a PropertyProxy was not found or if the given Class is null. */ public PropertyProxy getProxy(Class c) { return getProxy(c, true, false); }
/** * Locates a custom PropertyProxy for the given Class. The entire class * hierarchy is searched. If a match is found in the class heirarchy the * PropertyProxy is registered for the given class. * * @param c the Class used to search the registry. * @return the custom PropertyProxy registered for the Class or * null if a PropertyProxy was not found or if the given Class is null. */ public PropertyProxy getProxyAndRegister(Class c) { return getProxy(c, true, true); }
/** * Locates a custom PropertyProxy for the given Class. The entire class * hierarchy is searched. If a match is found in the class heirarchy the * PropertyProxy is registered for the given class. * * @param c the Class used to search the registry. * @return the custom PropertyProxy registered for the Class or * null if a PropertyProxy was not found or if the given Class is null. */ public PropertyProxy getProxyAndRegister(Class c) { return getProxy(c, true, true); }
/** * Serialize the provided object to the output stream. * Convert enums to their string representation for Actionscript. */ public void writeObject(Object o) throws IOException { if (o != null && o instanceof Enum && PropertyProxyRegistry.getRegistry().getProxy(o.getClass()) == null) { Enum enumValue = (Enum)o; writeString(enumValue.name()); } else { super.writeObject(o); } }
/** * Serialize an object using AMF0. Handles Java 5 constructs such as enum. * @param o the object to serialize * @throws IOException if there is a problem writing to the output stream */ public void writeObject(Object o) throws IOException { if (o != null && o instanceof Enum && PropertyProxyRegistry.getRegistry().getProxy(o.getClass()) == null) { Enum enumValue = (Enum)o; writeAMFString(enumValue.name()); } else { super.writeObject(o); } } }
/** * Serialize an object using AMF3. Handles Java 5 constructs such as enum. * @param o the object to serialize * @throws IOException if there is a problem writing to the output stream */ public void writeObject(Object o) throws IOException { // If there is a proxy for this, we'll write it as a custom object so that folks can // override the default serialization behavior for enums. if (o != null && o instanceof Enum && PropertyProxyRegistry.getRegistry().getProxy(o.getClass()) == null) { Enum enumValue = (Enum)o; writeAMFString(enumValue.name()); } else { super.writeObject(o); } } }
/** * Returns a PropertyProxy suitable for the given instance but does not * register 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 getProxy(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxy(c); if (proxy == null) { proxy = guessProxy(instance); } proxy = (PropertyProxy)proxy.clone(); proxy.setDefaultInstance(instance); return proxy; }
/** * Returns a PropertyProxy suitable for the given instance but does not * register 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 getProxy(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxy(c); if (proxy == null) { proxy = guessProxy(instance); } proxy = (PropertyProxy)proxy.clone(); proxy.setDefaultInstance(instance); return proxy; }
/** * */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { out.write(kObjectType); if (!byReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete, ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { out.write(kObjectType); if (!byReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete, ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * Returns a PropertyProxy suitable for the given instance but does not * register 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 getProxy(Object instance) { if (instance instanceof PropertyProxy) return (PropertyProxy)instance; Class c = instance.getClass(); PropertyProxy proxy = getRegistry().getProxy(c); if (proxy == null) { proxy = guessProxy(instance); } proxy = (PropertyProxy)proxy.clone(); proxy.setDefaultInstance(instance); return proxy; }
/** * @exclude */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { out.write(kObjectType); if (!byReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete, ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { if (!serializeAsReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * @exclude */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { if (!byReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete, ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { if (!byReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete, ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * @exclude */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { if (!serializeAsReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }
/** * */ protected void writeArrayCollection(Collection col, SerializationDescriptor desc) throws IOException { if (!serializeAsReference(col)) { ArrayCollection ac; if (col instanceof ArrayCollection) { ac = (ArrayCollection)col; // TODO: QUESTION: Pete ignoring the descriptor here... not sure if // we should modify the user's AC as that could cause corruption? } else { // Wrap any Collection in an ArrayCollection ac = new ArrayCollection(col); if (desc != null) ac.setDescriptor(desc); } // Then wrap ArrayCollection in PropertyProxy for bean-like serialization PropertyProxy proxy = PropertyProxyRegistry.getProxy(ac); writePropertyProxy(proxy, ac); } }