ImplementJavaInterface

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.

DetailsDetails

  • 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 . The arguments passed to the Mathematica method will be exactly the arguments originally passed to the Java method.
New to Mathematica? Find your learning path »
Have a question? Ask support »