public Iterable<ModelField> getAllFields() { return fields.values(); }
protected String calculateSerialization(PrimitiveSerializer primitives) { if (serialized != null) { return serialized; } // We will build our policy in our own buffer, so we can safely use it to calculate our strong hash later final CharBuffer policy = new CharBuffer(); policy.append(primitives.serializeString(getModuleName())); primitives = new ClusteringPrimitiveSerializer(primitives, policy); // Directly append the policy to the result (the string is not wrapped), // however, we do append the size of the manifests so we know when to stop deserializing policy.append(primitives.serializeInt(manifests.size())); for (final ModelManifest manifest : manifests.values()) { // TODO: collect up reused strings like classnames, and append them into a "classpool", // to reduce the total size of the policy ModelManifest.serialize(policy, manifest, primitives); } serialized = policy.toString(); return serialized; }
public Iterable<ModelField> getAllSerializable() { final Fifo<ModelField> fifo = X_Collect.newFifo(); for (final ModelField field : fields.values()) { final Serializable serial = field.getSerializable(); if (serial == null) { final ClientToServer c2s = field.getClientToServer(); if (c2s != null && c2s.enabled()) { fifo.give(field); continue; } final ServerToClient s2c = field.getServerToClient(); if (s2c != null && s2c.enabled()) { fifo.give(field); continue; } } else { // class is marked serializable fifo.give(field); } } return fifo.forEach(); }