Package org.jbox2d.serialization
Interface JbDeserializer
- All Known Implementing Classes:
PbDeserializer
public interface JbDeserializer
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Called for each physics object with a tag defined. -
Method Summary
Modifier and TypeMethodDescriptiondeserializeBody
(World world, java.io.InputStream input) Deserializes a bodydeserializeFixture
(Body body, java.io.InputStream input) Deserializes a fixturedeserializeJoint
(World world, java.io.InputStream input, java.util.Map<java.lang.Integer, Body> bodyMap, java.util.Map<java.lang.Integer, Joint> jointMap) Deserializes a jointdeserializeShape
(java.io.InputStream input) Deserializes a shapedeserializeWorld
(java.io.InputStream input) Deserializes a worldvoid
setObjectListener
(JbDeserializer.ObjectListener argListener) Sets the object listener, which allows the user to process each physics object with a tag to do any sort of custom logic.void
setUnsupportedListener
(UnsupportedListener argListener) Sets a listener for unsupported exceptions instead of stopping the whole deserialization process by throwing and exception.
-
Method Details
-
setObjectListener
Sets the object listener, which allows the user to process each physics object with a tag to do any sort of custom logic.- Parameters:
argListener
-
-
setUnsupportedListener
Sets a listener for unsupported exceptions instead of stopping the whole deserialization process by throwing and exception.- Parameters:
argListener
-
-
deserializeWorld
World deserializeWorld(java.io.InputStream input) throws java.io.IOException, UnsupportedObjectException Deserializes a world- Parameters:
input
-- Returns:
- Throws:
java.io.IOException
UnsupportedObjectException
- if a read physics object is unsupported by this library- See Also:
-
deserializeBody
Body deserializeBody(World world, java.io.InputStream input) throws java.io.IOException, UnsupportedObjectException Deserializes a body- Parameters:
world
-input
-- Returns:
- Throws:
java.io.IOException
UnsupportedObjectException
- if a read physics object is unsupported by this library- See Also:
-
deserializeFixture
Fixture deserializeFixture(Body body, java.io.InputStream input) throws java.io.IOException, UnsupportedObjectException Deserializes a fixture- Parameters:
body
-input
-- Returns:
- Throws:
java.io.IOException
UnsupportedObjectException
- if a read physics object is unsupported by this library- See Also:
-
deserializeShape
Shape deserializeShape(java.io.InputStream input) throws java.io.IOException, UnsupportedObjectException Deserializes a shape- Parameters:
input
-- Returns:
- Throws:
java.io.IOException
UnsupportedObjectException
- if a read physics object is unsupported by this library- See Also:
-
deserializeJoint
Joint deserializeJoint(World world, java.io.InputStream input, java.util.Map<java.lang.Integer, Body> bodyMap, java.util.Map<java.lang.Integer, throws java.io.IOException, UnsupportedObjectExceptionJoint> jointMap) Deserializes a joint- Parameters:
world
-input
-bodyMap
-jointMap
-- Returns:
- Throws:
java.io.IOException
UnsupportedObjectException
- if a read physics object is unsupported by this library- See Also:
-