Since E sits on top of the JVM is capable of using quite everything the Java world exposes.
Package access
We can import a class from the underlying Java virtual machine with the import statement, and speak to the Java object much as we would speak to an E object
[code lang="javascript"]
create a single vector with a direct call to Java
def vector :=
create a makeVector function which can be called repeatedly to make more vectors
def makeVector :=
create a shorthand for the java.util package, that gives quick access to all the
classes in java.util
def
unsafe: is of the many uri getters available in E. Others are file: (already seen), the programmer-defined util:, swing: (to access javax.swing) and awt: (to access java.awt), resource: (for read-only access to resource files such as images, sounds, and static texts) and import:.
The import: uriGetter is similar to unsafe:, except it only imports those parts of the Java API that have been audited for capability security and found to convey no authority. So import: is often useful in these security-aware situations. A complete list of safe versus unsafe classes, and the small percentage of Java API methods which are suppressed for security reasons, are listed in the documentation.
Public constants
As noted earlier, E does not have an expression to directly represent public static final variables. To use such static finals from a Java class, put parentheses at the end of the variable name, making it syntactically look like a function call, prefix it with “get”, uppercase the first letter, and E will get the value for you:
[code lang="javascript"]
Access to overloaded methods
E.call() function can be used to access overloaded methods in this way:
[code lang="javascript"] E.call(javaObject, "method(String, int)", ["abc", 23]) [/code]
The first argument is the object to send the message to, the second is the full signature of the method and the third argument are the parameters to pass to the invoked method.
With E you have also the Java power in your pocket!
















