Facilitates converting between complex custom Java classes and OtpErlang* classes
Latest commit 8b29d72 Aug 26, 2010 @dmitriid expanded README a bit
Failed to load latest commit information.
src/java/com/dmitriid first commit Aug 26, 2010
LICENSE first commit Aug 26, 2010
README.markdown expanded README a bit Aug 26, 2010


This is a simple and some what dumb library to facliltate conversion between custom Java types and Erlang.

CoversionManager cm = new ConversionManager();

// loads basic convertors for integers, booleans, 
// strings and the like

ArrayList arr = new ArrayList();

OtpErlangList list = cm.convert(arr);
// if you send this list over to Erlang, you'll get
// ["hello", 10] 

A basic usage would be something like this:

ConversionManager cm = new ConversionManager();

    new MyCustomConverter1(),
    new MyCustomConverter2(),
    new MyCustomConverter3()

OtpNode self = new OtpNode("node@localhost");
OtpMbox mbox = self.createMbox("mbox");

while(true) {
    Object o = o = mbox.receive();

    Object result = do_something_horrible(o);
    OtpErlangObject out = cm.convert(result);

    mbox.send(from, out);

See implementation of ArrayListConverter to see how to create a fairly complex converter.
See implementation of ConversionManager.registerBasic to see how to register your own converters.