This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)


ImplementJavaInterface[interfaces, mappings]
uses the Dynamic Proxy facility of Java to create a new Java class and return an object of that class that implements the named interface or list of interfaces by calling back into Mathematica. In short, it lets you create a Java object that implements a given Java interface entirely in Mathematica code.
  • To use ImplementJavaInterface, you first need to load J/Link using Needs["JLink`"].
  • mappings is a list of rules that specify the name of the Java method and the name of the method that will be called in Mathematica to implement the body of that method, as in "intfMeth1"->"mathHandlerMethod1". The arguments passed to the Mathematica method will be exactly the arguments originally passed to the Java method.