I believe this should give you a good idea about how to go about this.
import netscape.javascript.*;
public class MyClass implements Serializable {
public String a;
public String b;
public JavaDog(JSObject o) {
this.a= (String)o.getMember("a");
this.b = (String)o.getMember("b");
}
}
Then you use new Packages.MyClass(yourJavaScriptObject)
to create the object you want to pass to Java.
More information here:
https://developer.mozilla.org/en-US/docs/JavaScript/Guide/LiveConnect_Overview