public abstract class SerializerBase extends Object implements Serializer
javaemul.internal.HashCodes#getObjectIdentityHashcode(Object)
In hosted
mode, we map the underlying signature JsArray onto a proper IdentityHashMap.Modifier and Type | Class and Description |
---|---|
protected static class |
SerializerBase.MethodMap
Used in JavaScript to map a type to a set of serialization functions.
|
Constructor and Description |
---|
SerializerBase(Map<String,String> methodMapJava,
SerializerBase.MethodMap methodMapNative,
Map<String,String> signatureMapJava,
JsArrayString signatureMapNative) |
Modifier and Type | Method and Description |
---|---|
void |
deserialize(SerializationStreamReader stream,
Object instance,
String typeSignature)
Restore an instantiated object from the serialized stream.
|
String |
getSerializationSignature(Class<?> clazz)
Return the serialization signature for the given type.
|
Object |
instantiate(SerializationStreamReader stream,
String typeSignature)
Instantiate an object of the given typeName from the serialized stream.
|
void |
serialize(SerializationStreamWriter stream,
Object instance,
String typeSignature)
Save an instance into the serialization stream.
|
public SerializerBase(Map<String,String> methodMapJava, SerializerBase.MethodMap methodMapNative, Map<String,String> signatureMapJava, JsArrayString signatureMapNative)
public final void deserialize(SerializationStreamReader stream, Object instance, String typeSignature) throws SerializationException
Serializer
deserialize
in interface Serializer
SerializationException
public final String getSerializationSignature(Class<?> clazz)
Serializer
getSerializationSignature
in interface Serializer
public final Object instantiate(SerializationStreamReader stream, String typeSignature) throws SerializationException
Serializer
instantiate
in interface Serializer
SerializationException
public final void serialize(SerializationStreamWriter stream, Object instance, String typeSignature) throws SerializationException
Serializer
serialize
in interface Serializer
SerializationException
Copyright © 2018. All rights reserved.