JavaScript objects

A JavaScript object (when created with new Object()) is automatically converted to a map of properties when used as an argument to a Java method. A map is a Java interface that provides a list of name/value pairs. For example, you should pass a map when you call an XML adapter.

The following is an example of how to create a map:

map = new Object();
map.property1 = "Value 1";
map.property2 = "Value 2";
javaMethod( map );

This capability makes it easier to use maps from JavaScript. The following example illustrates how to call an XML adapter:

function f() {
	obj = new Object();
	obj.property1 = 7934;
	obj.property2 = "Value 2";
	doc = new DOMDocument();
	doc.loadFromXMLAdapter("test",obj,null);
}