Child pages
  • Documenting the Plugin API

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The benefits of the change is largely for plugin developers: the new mechanism allows the developer to tie the documentation directly to the methods/properties in code, instead of in separate methods.

The IScriptable Interface

The IScriptable interface is an empty interface that classes that expose methods or properties to the JavaScript layer in Servoy have to implement. When plugins get loaded in Servoy Developer, for all classes that implement this interface, the documentation will be loaded. For more information refer to the IScriptable API doc in the Servoy API.

...

The .getAllReturnedTypes() method of the deprecated IScriptObject is replaced by separate interface IReturnedTypesProvider, which only needs to be implemented on plugin classes that have actual returnTypes.

Documenting method & properties using JavaDoc

When implementing the new documentation mechanism, the method sample code, tooltip, parameter names will have to be documented using JavaDoc. For more details on writing documentation in the Javadoc way, see the Javadoc reference pages. This type of code documentation is a standard way of documenting Java code.

...

Code Block
 /** @type {JSFile} */

The Documentation Generator Tool

After annotating the source of the plugin using JavaDoc, the documentation needs to be exported to XML format and bundled with the plugin. Servoy provides a Eclipse plugin to generate the XML, called the Documentation Generator.

...