/** * Returns the backing Array of the <tt>ArrayCollection</tt>. * * @return The backing Array. */ public Object[] getSource() { return toArray(); }
/** * @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); } }
/** * Sets the sources with the supplied Collection. * * @param s The source Collection. */ public void setSource(Collection s) { addAll(s); }
message.setOperation(packet.getOperation()); ArrayCollection arguments = new ArrayCollection(); Iterator parsIt = packet.getPars().iterator(); while (parsIt.hasNext()) { arguments.add(parsIt.next());
public void addAll(Object[] array) { for (Object o : array) add(o); }
protected void writeAMF3Collection(Collection<?> c) throws IOException { if (debugMore) logMore.debug("writeAMF3Collection(c=%s)", c); Channel channel = getChannel(); if (channel != null && channel.isLegacyCollectionSerialization()) writeAMF3Array(c.toArray()); else { ArrayCollection ac = (c instanceof ArrayCollection ? (ArrayCollection)c : new ArrayCollection(c)); writeAMF3Object(ac); } }
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException { Object s = input.readObject(); if (s instanceof Collection) s = ((Collection)s).toArray(); Object[] source = (Object[])s; setSource(source); }
public void writeExternal(ObjectOutput output) throws IOException { if (descriptor == null) output.writeObject(getSource()); else { Object[] source = getSource(); if (source == null) output.writeObject(null); else { for (int i = 0; i < source.length; i++) { Object item = source[i]; if (item == null) source[i] = null; else { PropertyProxy proxy = PropertyProxyRegistry.getProxy(item); proxy = (PropertyProxy)proxy.clone(); proxy.setDescriptor(descriptor); proxy.setDefaultInstance(item); source[i] = proxy; } } output.writeObject(source); } } } }
/** * */ 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); } }
public ArrayCollection(Object[] array) { super(); addAll(array); }
public void addAll(Object[] array) { for (Object o : array) add(o); }
/** * Implements {@link Externalizable#readExternal(ObjectInput)} * * @param input The object input. */ public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException { Object s = input.readObject(); if (s instanceof Collection) s = ((Collection)s).toArray(); Object[] source = (Object[])s; setSource(source); }
/** * @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); } }
/** * Sets the sources with the supplied Collection. * * @param s The source Collection. */ public void setSource(Collection s) { addAll(s); }
/** * Returns the backing Array of the <tt>ArrayCollection</tt>. * * @return The backing Array. */ public Object[] getSource() { return toArray(); }