JavaScript Supported Types

org.eclipse.swt.browser.Browser.evaluate(String) and org.eclipse.swt.browser.BrowserFunction.execute(Object[]) methods send values back and forth between JavaScript and Java.

If the values being passed are types , types get converted.  The table below shows the type conversions that happen.  Attempts to pass an unsupported type will cause an SWTException.

JavaScript Type

Java Type

null null
undefined null
number java.lang.Double
string java.lang.String
boolean java.lang.Boolean
array of supported types java.lang.Object[] of supported types
Advertisements

One Response to JavaScript Supported Types

  1. Pingback: Riding the Editor Life Cycle | Dean on Eclipse

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s