Implementation of Java Connector

 In this page, I'll show you how to implement function in java, and use it.

Implementation

 This is the implementation of the JavaConnector sample project. By understanding this sample, you can make your function working on the Alinous-Script.

Function implementation

 The implementation of the function is below.

 The JavaConnector class implements "IAlinousFunction" interface. This interface is defined at the "alinousjc.jar" in "ALINOUS_HOME/lib/" folder.

In order to make JavaScript funtion, you have to do is next list.

  • Declare prefix at "public String getPrefix() "
  • Make functions to call
  • Export them at "public String[] getFunctions()"
  • (Optional)Add contents assist information at "public String codeAssistString(String funcName)" and "public String descriptionString(String funcName)"

Funtion's parameters

 Parameters of these functions are detected and translated automatically.

You can use

  • Java primitives objects(String, Int, Long)
  • Java beans which has Java primirtive Object members
  • Array of these

as the type of parameter.

Next code is a sample of JavaBean used in the previous code.

 


Go to Top