Package io.deephaven.plugin.js
Class JsPlugin
java.lang.Object
io.deephaven.plugin.PluginBase
io.deephaven.plugin.js.JsPlugin
- All Implemented Interfaces:
Plugin
,Registration
A JS plugin is a
Plugin
that allows for custom javascript and related content to be served, see
io.deephaven.plugin.js
.
For example, if the following JS plugin was the only JS plugin installed
JsPlugin.builder() .name("foo") .version("1.0.0") .main(Path.of("dist/index.js")) .path(Path.of("/path-to/my-plugin")) .build()the manifest served at "js-plugins/manifest.json" would be equivalent to
{ "plugins": [ { "name": "foo", "version": "1.0.0", "main": "dist/index.js" } ] }and all files of the form "/path-to/my-plugin/{somePath}" would be served at "js-plugins/foo/{somePath}".
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.plugin.Plugin
Plugin.Visitor<T>
Nested classes/interfaces inherited from interface io.deephaven.plugin.Registration
Registration.Callback
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JsPlugin.Builder
builder()
abstract Path
main()
The main JS file path, specified relative topath()
.abstract String
name()
The JS plugin name.abstract Path
path()
The directory path of the resources to serve.paths()
The subset of resources frompath()
to serve.abstract String
version()
The JS plugin version.final <T,
V extends Plugin.Visitor<T>>
Twalk
(V visitor) Methods inherited from class io.deephaven.plugin.PluginBase
registerInto
-
Constructor Details
-
JsPlugin
public JsPlugin()
-
-
Method Details
-
builder
-
name
The JS plugin name. The JS plugin contents will be served under the URL path "js-plugins/{name}/", as well as included as the "name" field for the manifest entry in "js-plugins/manifest.json". The "/" character will not be URL encoded - the name "@example/foo" would be served under the URL path "js-plugins/@example/foo/".- Returns:
- the name
-
version
The JS plugin version. Will be included as the "version" field for the manifest entry in "js-plugins/manifest.json".- Returns:
- the version
-
main
The main JS file path, specified relative topath()
. The main JS file must exist (Files.isRegularFile(root().resolve(main()))
) and must be included inpaths()
. Will be included as the "main" field for the manifest entry in "js-plugins/manifest.json".- Returns:
- the main JS file path
-
path
The directory path of the resources to serve. The resources will be served via the URL path "js-plugins/{name}/{relativeToPath}". The path must exist (Files.isDirectory(path())
).- Returns:
- the path
-
paths
The subset of resources frompath()
to serve. Production installations should preferably be packaged with the exact resources necessary (and thus served withPaths.all()
). During development, other subsets may be useful ifpath()
contains content unrelated to the JS content. By default, isPaths.all()
.- Returns:
- the paths
-
walk
-