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 argBody)
          Serializes a body
 SerializationResult serialize(org.jbox2d.dynamics.Fixture argFixture)
          Serializes a fixture
 SerializationResult serialize(org.jbox2d.dynamics.joints.Joint argJoint, java.util.Map<org.jbox2d.dynamics.Body,java.lang.Integer> argBodyIndexMap, java.util.Map<org.jbox2d.dynamics.joints.Joint,java.lang.Integer> argJointIndexMap)
          Serializes joints.
 SerializationResult serialize(org.jbox2d.collision.shapes.Shape argShape)
          Serializes a shape
 SerializationResult serialize(org.jbox2d.dynamics.World argWorld)
          Serializes the world
 void setObjectSigner(JbSerializer.ObjectSigner argSigner)
          Sets the object signer for the serializer.
 void setUnsupportedListener(UnsupportedListener argListener)
          Sets a listener for unsupported exception instead of stopping the whole serialization process by throwing and exception.
 

Method Detail

setObjectSigner

void setObjectSigner(JbSerializer.ObjectSigner argSigner)
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:
argSigner -

setUnsupportedListener

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

Parameters:
argListener -

serialize

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

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

serialize

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

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

serialize

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

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

serialize

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

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

serialize

SerializationResult serialize(org.jbox2d.dynamics.joints.Joint argJoint,
                              java.util.Map<org.jbox2d.dynamics.Body,java.lang.Integer> argBodyIndexMap,
                              java.util.Map<org.jbox2d.dynamics.joints.Joint,java.lang.Integer> argJointIndexMap)
Serializes joints. Joints need to reference bodies and sometimes other joints.

Parameters:
argJoint -
argBodyIndexMap -
argJointIndexMap -
Returns:


Copyright © 2012. All Rights Reserved.