com.google.gwt.user.server.rpc.impl
Class ServerSerializationStreamWriter
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
- All Implemented Interfaces:
- SerializationStreamWriter
public final class ServerSerializationStreamWriter
- extends AbstractSerializationStreamWriter
For internal use only. Used for server call serialization. This class is
carefully matched with the client-side version.
|
Method Summary |
static java.lang.String |
escapeString(java.lang.String toEscape)
This method takes a string and outputs a JavaScript string literal. |
void |
prepareToWrite()
|
void |
serializeValue(java.lang.Object value,
java.lang.Class<?> type)
|
java.lang.String |
toString()
Build an array of JavaScript string literals that can be decoded by the
client via the eval function. |
void |
writeLong(long value)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ServerSerializationStreamWriter
public ServerSerializationStreamWriter(SerializationPolicy serializationPolicy)
escapeString
public static java.lang.String escapeString(java.lang.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.
prepareToWrite
public void prepareToWrite()
- Overrides:
prepareToWrite in class AbstractSerializationStreamWriter
serializeValue
public void serializeValue(java.lang.Object value,
java.lang.Class<?> type)
throws SerializationException
- Throws:
SerializationException
toString
public java.lang.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.
- Specified by:
toString in interface SerializationStreamWriter- Specified by:
toString in class AbstractSerializationStreamWriter
- Returns:
- a string that is the serialization of the contents of this stream
writeLong
public void writeLong(long value)
- Specified by:
writeLong in interface SerializationStreamWriter- Specified by:
writeLong in class AbstractSerializationStreamWriter