org.jbox2d.serialization
Interface JbSerializer

All Known Implementing Classes:
PbSerializer

public interface JbSerializer

Serializer for jbox2d, used to serialize any aspect of the physics world

Author:
Daniel

Nested Class Summary
static interface JbSerializer.ObjectSigner
          Interface that allows the serializer to look up tags for each object, which can be used later during deserializing by the developer.
 
Method Summary
 SerializationResult serialize(org.jbox2d.dynamics.Body body)
          Serializes a body
 SerializationResult serialize(org.jbox2d.dynamics.Fixture fixture)
          Serializes a fixture
 SerializationResult serialize(org.jbox2d.dynamics.joints.Joint joint, Map<org.jbox2d.dynamics.Body,Integer> bodyIndexMap, Map<org.jbox2d.dynamics.joints.Joint,Integer> jointIndexMap)
          Serializes joints.
 SerializationResult serialize(org.jbox2d.collision.shapes.Shape shape)
          Serializes a shape
 SerializationResult serialize(org.jbox2d.dynamics.World world)
          Serializes the world
 void setObjectSigner(JbSerializer.ObjectSigner signer)
          Sets the object signer for the serializer.
 void setUnsupportedListener(UnsupportedListener listener)
          Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.
 

Method Detail

setObjectSigner

void setObjectSigner(JbSerializer.ObjectSigner signer)
Sets the object signer for the serializer. This allows the user to specify an 'tag' for each main physics object, which is then referenced later at deserialization for the user.

Parameters:
signer -

setUnsupportedListener

void setUnsupportedListener(UnsupportedListener listener)
Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.

Parameters:
listener -

serialize

SerializationResult serialize(org.jbox2d.dynamics.World world)
                              throws UnsupportedObjectException
Serializes the world

Parameters:
world -
Returns:
Throws:
UnsupportedObjectException - if a physics object is unsupported by this library.
See Also:
setUnsupportedListener(UnsupportedListener)

serialize

SerializationResult serialize(org.jbox2d.dynamics.Body body)
                              throws UnsupportedObjectException
Serializes a body

Parameters:
body -
Returns:
Throws:
UnsupportedObjectException - if a physics object is unsupported by this library.
See Also:
setUnsupportedListener(UnsupportedListener)

serialize

SerializationResult serialize(org.jbox2d.dynamics.Fixture fixture)
                              throws UnsupportedObjectException
Serializes a fixture

Parameters:
fixture -
Returns:
Throws:
UnsupportedObjectException - if a physics object is unsupported by this library.
See Also:
setUnsupportedListener(UnsupportedListener)

serialize

SerializationResult serialize(org.jbox2d.collision.shapes.Shape shape)
                              throws UnsupportedObjectException
Serializes a shape

Parameters:
shape -
Returns:
Throws:
UnsupportedObjectException - if a physics object is unsupported by this library.
See Also:
setUnsupportedListener(UnsupportedListener)

serialize

SerializationResult serialize(org.jbox2d.dynamics.joints.Joint joint,
                              Map<org.jbox2d.dynamics.Body,Integer> bodyIndexMap,
                              Map<org.jbox2d.dynamics.joints.Joint,Integer> jointIndexMap)
Serializes joints. Joints need to reference bodies and sometimes other joints.

Parameters:
joint -
bodyIndexMap -
jointIndexMap -
Returns:


Copyright © 2013. All Rights Reserved.