com.google.gwt.user.server.rpc
Class ServerSerializationStream

java.lang.Object
  extended bycom.google.gwt.user.client.rpc.SerializationStream
      extended bycom.google.gwt.user.server.rpc.ServerSerializationStream
All Implemented Interfaces:
SerializationStreamObjectDecoder, SerializationStreamObjectEncoder, SerializationStreamReader, SerializationStreamWriter, StringTable

public class ServerSerializationStream
extends SerializationStream

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


Field Summary
 
Fields inherited from class com.google.gwt.user.client.rpc.SerializationStream
flags, NEW_INSTANCE_MARKER, NULL_INSTANCE_MARKER, PREV_INSTANCE_MARKER, SERIALIZATION_STREAM_FLAGS_NO_TYPE_VERSIONING, SERIALIZATION_STREAM_VERSION, version
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
ServerSerializationStream(com.google.gwt.user.server.rpc.ServerSerializableTypeOracle serializableTypeOracle)
           
 
Method Summary
 int addString(String string)
          Add a string to this string table.
 void append(String token)
           
 Object deserializeValue(Class type)
           
 void endInstance(SerializationStreamWriter streamWriter, Object instance)
          Mark the end of instance in the stream.
 String extract()
           
protected  String getInstanceName(String token)
           
 SerializationStreamObjectDecoder getObjectDecoder()
           
 SerializationStreamObjectEncoder getObjectEncoder()
           
 String getString(int index)
          Get the string that is associated with the requested index.
 int getStringCount()
          Get the number of strings in the table.
 StringTable getStringTable()
          Get the string table associated with this decoder.
protected  String getTypeName(String token)
           
 Object lookupDecodedObject(String id)
           
 String nextInstance(SerializationStreamReader stream)
          Get's the binary name of the next instance in the serialization stream.
 void prepareToRead(String encodedTokens)
           
 void prepareToWrite()
           
 Object prevInstance(SerializationStreamReader stream)
          See if the next method in the stream is a previously seen method.
 Object readObject()
           
 void rememberDecodedObject(Object o)
          Save this instance in case it is ferenced later on in the stream.
 void serializeValue(Object value, Class type)
           
 boolean startInstance(SerializationStreamWriter streamWriter, Object instance)
          Mark the start of an instance.
 String toString()
          Build an array of JavaScript string literals that can be decoded by the client via the eval function.
 void writeObject(Object value)
           
 
Methods inherited from class com.google.gwt.user.client.rpc.SerializationStream
addFlags, getFlags, getVersion, readBoolean, readByte, readChar, readDouble, readFloat, readInt, readLong, readShort, setFlags, setVersion, shouldEnforceTypeVersioning, writeBoolean, writeByte, writeChar, writeDouble, writeFloat, writeInt, writeLong, writeShort
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode
 

Constructor Detail

ServerSerializationStream

public ServerSerializationStream(com.google.gwt.user.server.rpc.ServerSerializableTypeOracle serializableTypeOracle)
Method Detail

getTypeName

protected String getTypeName(String token)

addString

public int addString(String string)
Description copied from interface: StringTable
Add a string to this string table. Returns the index assigned to this string in the table.

Parameters:
string -
Returns:
index of the string in the string table

prepareToRead

public void prepareToRead(String encodedTokens)
Specified by:
prepareToRead in class SerializationStream

extract

public String extract()
Specified by:
extract in class SerializationStream

prepareToWrite

public void prepareToWrite()
Specified by:
prepareToWrite in class SerializationStream

append

public void append(String token)
Specified by:
append in class SerializationStream

toString

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.


startInstance

public boolean startInstance(SerializationStreamWriter streamWriter,
                             Object instance)
                      throws SerializationException
Description copied from interface: SerializationStreamObjectEncoder
Mark the start of an instance. This method returns true if the method instance has already been stored into the serialization stream. If the object is already stored then no writeObject calls should be made.

Throws:
SerializationException

endInstance

public void endInstance(SerializationStreamWriter streamWriter,
                        Object instance)
Description copied from interface: SerializationStreamObjectEncoder
Mark the end of instance in the stream.


nextInstance

public String nextInstance(SerializationStreamReader stream)
Description copied from interface: SerializationStreamObjectDecoder
Get's the binary name of the next instance in the serialization stream.


prevInstance

public Object prevInstance(SerializationStreamReader stream)
Description copied from interface: SerializationStreamObjectDecoder
See if the next method in the stream is a previously seen method. If it is then we return it. If not we return null.


rememberDecodedObject

public void rememberDecodedObject(Object o)
Description copied from interface: SerializationStreamObjectDecoder
Save this instance in case it is ferenced later on in the stream.

Parameters:
o - - object that we want to be able to recall via prevInstance.

lookupDecodedObject

public Object lookupDecodedObject(String id)

getObjectDecoder

public SerializationStreamObjectDecoder getObjectDecoder()
Specified by:
getObjectDecoder in interface SerializationStreamReader
Specified by:
getObjectDecoder in class SerializationStream

getObjectEncoder

public SerializationStreamObjectEncoder getObjectEncoder()
Specified by:
getObjectEncoder in interface SerializationStreamWriter
Specified by:
getObjectEncoder in class SerializationStream

getString

public String getString(int index)
Description copied from interface: StringTable
Get the string that is associated with the requested index.

Parameters:
index -
Returns:
String associated with the requested index

deserializeValue

public Object deserializeValue(Class type)
                        throws SerializationException
Throws:
SerializationException

serializeValue

public void serializeValue(Object value,
                           Class type)
                    throws SerializationException
Throws:
SerializationException

getInstanceName

protected String getInstanceName(String token)

readObject

public Object readObject()
                  throws SerializationException
Throws:
SerializationException

writeObject

public void writeObject(Object value)
                 throws SerializationException
Throws:
SerializationException

getStringTable

public StringTable getStringTable()
Description copied from interface: SerializationStreamObjectDecoder
Get the string table associated with this decoder.

Returns:

getStringCount

public int getStringCount()
Description copied from interface: StringTable
Get the number of strings in the table.

Returns:
the number of strings in the string table.


This javadoc distribution was not produced by Google. The official documentation is here.