Package org.graalvm.polyglot
Class PolyglotAccess
java.lang.Object
org.graalvm.polyglot.PolyglotAccess
Represents an access policy for polyglot builtins in the guest languages.
If the two predefined access policies NONE
and ALL
are not sufficient then a
custom access configuration may be created using newBuilder()
. This allows to grant
individual access rights between the language.
The following access rights may be granted:
- The ability to evaluate code
between
two or just forone
language. If a language has access to at least one other language then the polyglot eval builtin will be available, otherwise access to that builtin might be restricted. The concrete name of the polyglot eval builtin is language specific. In JavaScript it is calledPolyglot.eval
. - The ability to access members in the
polyglot bindings
. The names of the guest language builtins to access polyglot bindings are language specific. In JavaScript they are calledPolyglot.import
andPolyglot.export
.
ALL
is used. In this mode polyglot evaluation builtins are available even if there is
just one installed
language available.- Since:
- 19.0
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
A builder for a polyglot access configuration. -
Field Summary
Modifier and TypeFieldDescriptionstatic final PolyglotAccess
Provides guest languages full access to other languages using polyglot evaluation and binding builtins.static final PolyglotAccess
Provides guest languages no access to other languages using polyglot builtins evaluation and binding builtins. -
Method Summary
Modifier and TypeMethodDescriptionstatic PolyglotAccess.Builder
Creates a new custom polyglot access configuration builder.
-
Field Details
-
NONE
Provides guest languages no access to other languages using polyglot builtins evaluation and binding builtins.- Since:
- 19.0
-
ALL
Provides guest languages full access to other languages using polyglot evaluation and binding builtins.- Since:
- 19.0
-
-
Method Details
-
newBuilder
Creates a new custom polyglot access configuration builder. A polyglot access builder starts with no access rights.- Since:
- 19.2
-