public final class

ServerSerializationStreamWriter

extends AbstractSerializationStreamWriter
java.lang.Object
   ↳ com.google.gwt.user.client.rpc.impl.AbstractSerializationStream
     ↳ com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter
       ↳ com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter

Class Overview

For internal use only. Used for server call serialization. This class is carefully matched with the client-side version.

Summary

Nested Classes
class ServerSerializationStreamWriter.LengthConstrainedArray Builds a string that evaluates into an array containing the given elements. 
[Expand]
Inherited Constants
From class com.google.gwt.user.client.rpc.impl.AbstractSerializationStream
Public Constructors
ServerSerializationStreamWriter(SerializationPolicy serializationPolicy)
Public Methods
static String escapeString(String toEscape)
This method takes a string and outputs a JavaScript string literal.
void prepareToWrite()
void serializeValue(Object value, Class<?> type)
String toString()
Build an array of JavaScript string literals that can be decoded by the client via the eval function.
void writeLong(long value)
Protected Methods
void append(String token)
Append a token to the underlying output buffer.
String getObjectTypeSignature(Object instance)
Compute and return the type signature for an object.
void serialize(Object instance, String typeSignature)
Serialize an object into the stream.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter
From class com.google.gwt.user.client.rpc.impl.AbstractSerializationStream
From class java.lang.Object
From interface com.google.gwt.user.client.rpc.SerializationStreamWriter

Public Constructors

public ServerSerializationStreamWriter (SerializationPolicy serializationPolicy)

Public Methods

public static String escapeString (String toEscape)

This method takes a string and outputs a JavaScript string literal. The data is surrounded with quotes, and any contained characters that need to be escaped are mapped onto their escape sequence. Assumptions: We are targeting a version of JavaScript that that is later than 1.3 that supports unicode strings.

public void prepareToWrite ()

public void serializeValue (Object value, Class<?> type)

public String toString ()

Build an array of JavaScript string literals that can be decoded by the client via the eval function. NOTE: We build the array in reverse so the client can simply use the pop function to remove the next item from the list.

public void writeLong (long value)

Protected Methods

protected void append (String token)

Append a token to the underlying output buffer.

Parameters
token the token to append

protected String getObjectTypeSignature (Object instance)

Compute and return the type signature for an object.

Parameters
instance the instance to inspect
Returns
  • the type signature of the instance

protected void serialize (Object instance, String typeSignature)

Serialize an object into the stream.

Parameters
instance the object to serialize
typeSignature the type signature of the object