|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.network.serializing.Serializer
public abstract class Serializer
The main serializer class, which will serialize objects such that they can be sent across the network. Serializing classes should extend this to provide their own serialization.
Field Summary | |
---|---|
protected static java.util.logging.Logger |
log
|
Constructor Summary | |
---|---|
Serializer()
|
Method Summary | ||
---|---|---|
static Serializer |
getExactSerializer(java.lang.Class cls)
|
|
static SerializerRegistration |
getExactSerializerRegistration(java.lang.Class cls)
|
|
static Serializer |
getSerializer(java.lang.Class cls)
|
|
static Serializer |
getSerializer(java.lang.Class cls,
boolean failOnMiss)
|
|
static SerializerRegistration |
getSerializerRegistration(java.lang.Class cls)
|
|
static SerializerRegistration |
getSerializerRegistration(java.lang.Class cls,
boolean failOnMiss)
|
|
void |
initialize(java.lang.Class clazz)
Registration for when a serializer may need to cache something. |
|
static SerializerRegistration |
readClass(java.nio.ByteBuffer buffer)
Read the class from given buffer and return its SerializerRegistration. |
|
static java.lang.Object |
readClassAndObject(java.nio.ByteBuffer buffer)
Read the class and the object. |
|
abstract
|
readObject(java.nio.ByteBuffer data,
java.lang.Class<T> c)
Read an object from the buffer, effectively deserializing it. |
|
static SerializerRegistration |
registerClass(java.lang.Class cls)
|
|
static SerializerRegistration |
registerClass(java.lang.Class cls,
boolean failOnMiss)
Registers the specified class. |
|
static SerializerRegistration |
registerClass(java.lang.Class cls,
Serializer serializer)
|
|
static void |
registerClasses(java.lang.Class... classes)
|
|
protected static SerializerRegistration |
registerClassForId(short id,
java.lang.Class cls,
Serializer serializer)
|
|
static SerializerRegistration[] |
registerPackage(java.lang.String pkgName)
Deprecated. This cannot be implemented in a reasonable way that works in all deployment methods. |
|
static void |
setStrictRegistration(boolean b)
When set to true, classes that do not have intrinsic IDs in their |
|
static SerializerRegistration |
writeClass(java.nio.ByteBuffer buffer,
java.lang.Class type)
Write a class and return its SerializerRegistration. |
|
static void |
writeClassAndObject(java.nio.ByteBuffer buffer,
java.lang.Object object)
Write the class and object. |
|
abstract void |
writeObject(java.nio.ByteBuffer buffer,
java.lang.Object object)
Write an object to the buffer, effectively serializing it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.logging.Logger log
Constructor Detail |
---|
public Serializer()
Method Detail |
---|
public static void setStrictRegistration(boolean b)
public static SerializerRegistration registerClass(java.lang.Class cls)
public static void registerClasses(java.lang.Class... classes)
protected static SerializerRegistration registerClassForId(short id, java.lang.Class cls, Serializer serializer)
public static SerializerRegistration registerClass(java.lang.Class cls, boolean failOnMiss)
@Deprecated public static SerializerRegistration[] registerPackage(java.lang.String pkgName)
public static SerializerRegistration registerClass(java.lang.Class cls, Serializer serializer)
public static Serializer getExactSerializer(java.lang.Class cls)
public static Serializer getSerializer(java.lang.Class cls)
public static Serializer getSerializer(java.lang.Class cls, boolean failOnMiss)
public static SerializerRegistration getExactSerializerRegistration(java.lang.Class cls)
public static SerializerRegistration getSerializerRegistration(java.lang.Class cls)
public static SerializerRegistration getSerializerRegistration(java.lang.Class cls, boolean failOnMiss)
public static SerializerRegistration readClass(java.nio.ByteBuffer buffer)
buffer
- The buffer to read from.
public static java.lang.Object readClassAndObject(java.nio.ByteBuffer buffer) throws java.io.IOException
buffer
- Buffer to read from.
java.io.IOException
- If serialization failed.public static SerializerRegistration writeClass(java.nio.ByteBuffer buffer, java.lang.Class type) throws java.io.IOException
buffer
- The buffer to write the given class to.type
- The class to write.
java.io.IOException
public static void writeClassAndObject(java.nio.ByteBuffer buffer, java.lang.Object object) throws java.io.IOException
buffer
- The buffer to write to.object
- The object to write.
java.io.IOException
- If serializing fails.public abstract <T> T readObject(java.nio.ByteBuffer data, java.lang.Class<T> c) throws java.io.IOException
data
- The buffer to read from.c
- The class of the object.
java.io.IOException
- If deserializing fails.public abstract void writeObject(java.nio.ByteBuffer buffer, java.lang.Object object) throws java.io.IOException
buffer
- The buffer to write to.object
- The object to serialize.
java.io.IOException
- If serializing fails.public void initialize(java.lang.Class clazz)
clazz
- The class that has been registered to the serializer.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |