Package org.jbox2d.serialization
Interface JbDeserializer
-
- All Known Implementing Classes:
PbDeserializer
public interface JbDeserializer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
JbDeserializer.ObjectListener
Called for each physics object with a tag defined.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Body
deserializeBody(World world, java.io.InputStream input)
Deserializes a bodyFixture
deserializeFixture(Body body, java.io.InputStream input)
Deserializes a fixtureJoint
deserializeJoint(World world, java.io.InputStream input, java.util.Map<java.lang.Integer,Body> bodyMap, java.util.Map<java.lang.Integer,Joint> jointMap)
Deserializes a jointShape
deserializeShape(java.io.InputStream input)
Deserializes a shapeWorld
deserializeWorld(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 Detail
-
setObjectListener
void 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.- Parameters:
argListener
-
-
setUnsupportedListener
void setUnsupportedListener(UnsupportedListener argListener)
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:
setUnsupportedListener(UnsupportedListener)
-
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:
setUnsupportedListener(UnsupportedListener)
-
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:
setUnsupportedListener(UnsupportedListener)
-
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:
setUnsupportedListener(UnsupportedListener)
-
deserializeJoint
Joint deserializeJoint(World world, java.io.InputStream input, java.util.Map<java.lang.Integer,Body> bodyMap, java.util.Map<java.lang.Integer,Joint> jointMap) throws java.io.IOException, UnsupportedObjectException
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:
setUnsupportedListener(UnsupportedListener)
-
-