com.jme3.network.serializing.serializers
Class FieldSerializer

java.lang.Object
  extended by com.jme3.network.serializing.Serializer
      extended by com.jme3.network.serializing.serializers.FieldSerializer

public class FieldSerializer
extends Serializer

The field serializer is the default serializer used for custom class.


Field Summary
 
Fields inherited from class com.jme3.network.serializing.Serializer
log
 
Constructor Summary
FieldSerializer()
           
 
Method Summary
protected  void checkClass(java.lang.Class clazz)
           
 void initialize(java.lang.Class clazz)
          Registration for when a serializer may need to cache something.
<T> T
readObject(java.nio.ByteBuffer data, java.lang.Class<T> c)
          Read an object from the buffer, effectively deserializing it.
 void writeObject(java.nio.ByteBuffer buffer, java.lang.Object object)
          Write an object to the buffer, effectively serializing it.
 
Methods inherited from class com.jme3.network.serializing.Serializer
getExactSerializer, getExactSerializerRegistration, getSerializer, getSerializer, getSerializerRegistration, getSerializerRegistration, readClass, readClassAndObject, registerClass, registerClass, registerClass, registerClasses, registerClassForId, registerPackage, setStrictRegistration, writeClass, writeClassAndObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldSerializer

public FieldSerializer()
Method Detail

checkClass

protected void checkClass(java.lang.Class clazz)

initialize

public void initialize(java.lang.Class clazz)
Description copied from class: Serializer
Registration for when a serializer may need to cache something. Override to use.

Overrides:
initialize in class Serializer
Parameters:
clazz - The class that has been registered to the serializer.

readObject

public <T> T readObject(java.nio.ByteBuffer data,
                        java.lang.Class<T> c)
             throws java.io.IOException
Description copied from class: Serializer
Read an object from the buffer, effectively deserializing it.

Specified by:
readObject in class Serializer
Parameters:
data - The buffer to read from.
c - The class of the object.
Returns:
The object read.
Throws:
java.io.IOException - If deserializing fails.

writeObject

public void writeObject(java.nio.ByteBuffer buffer,
                        java.lang.Object object)
                 throws java.io.IOException
Description copied from class: Serializer
Write an object to the buffer, effectively serializing it.

Specified by:
writeObject in class Serializer
Parameters:
buffer - The buffer to write to.
object - The object to serialize.
Throws:
java.io.IOException - If serializing fails.