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 interfaceJbDeserializer.ObjectListenerCalled for each physics object with a tag defined.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BodydeserializeBody(World world, java.io.InputStream input)Deserializes a bodyFixturedeserializeFixture(Body body, java.io.InputStream input)Deserializes a fixtureJointdeserializeJoint(World world, java.io.InputStream input, java.util.Map<java.lang.Integer,Body> bodyMap, java.util.Map<java.lang.Integer,Joint> jointMap)Deserializes a jointShapedeserializeShape(java.io.InputStream input)Deserializes a shapeWorlddeserializeWorld(java.io.InputStream input)Deserializes a worldvoidsetObjectListener(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.voidsetUnsupportedListener(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.IOExceptionUnsupportedObjectException- 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.IOExceptionUnsupportedObjectException- 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.IOExceptionUnsupportedObjectException- 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.IOExceptionUnsupportedObjectException- 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.IOExceptionUnsupportedObjectException- if a read physics object is unsupported by this library- See Also:
setUnsupportedListener(UnsupportedListener)
-
-