Package org.graalvm.polyglot
Class PolyglotAccess.Builder
java.lang.Object
org.graalvm.polyglot.PolyglotAccess.Builder
- Enclosing class:
PolyglotAccess
A builder for a polyglot access configuration. Builder instances are not thread-safe.
- Since:
- 19.2
-
Method Summary
Modifier and TypeMethodDescriptionallowBindingsAccess
(String language) Allows access to polyglot bindings for a language.Allows evaluation of code by one language of another.allowEvalBetween
(String... languages) Allows bidirectional evaluation of code between the given languages.build()
Creates an instance of the custom polyglot access configuration.denyBindingsAccess
(String language) Denies access to polyglot bindings for a language.Denies evaluation of code by one language of another.denyEvalBetween
(String... languages) Denies bidirectional evaluation of code between the given languages.
-
Method Details
-
allowEvalBetween
Allows bidirectional evaluation of code between the given languages. When called with language"A"
and language"B"
, this is equivalent to callingallowEval("A", "B")
andallowEval("B", "A")
. If called with more than two then all language evaluation combinations will be allowed. This method potentially overrides already configured access rights withallowEval(String, String)
ordenyEval(String, String)
. The given language array must be nonnull
and individual languages must not benull
.- Since:
- 19.2
- See Also:
-
denyEvalBetween
Denies bidirectional evaluation of code between the given languages. When called with language"A"
and language"B"
, this is equivalent to callingdenyEval("A", "B")
anddenyEval("B", "A")
. If called with more than two then all language access combinations will be denied. This method potentially overrides already configured access rights withallowEval(String, String)
ordenyEval(String, String)
. The given language array must be nonnull
and individual languages must not benull
.- Since:
- 19.2
- See Also:
-
allowEval
Allows evaluation of code by one language of another. This method only allows one-way evaluation access. Every language always has implicitly access to itself. If a language has access to one ore more different languages then the guest application will have access to polyglot evaluation builtins. If a language has no access granted to another language then access to polyglot evaluation builtins is denied.- Since:
- 19.2
- See Also:
-
denyEval
Denies evaluation of code by one language of another. This method only denies one-way evaluation. Every language has always evaluation access to itself. This access cannot be denied.- Since:
- 19.2
- See Also:
-
allowBindingsAccess
Allows access to polyglot bindings for a language. The names of the guest language builtins to access polyglot bindings are language specific. In JavaScript they are calledPolyglot.import
andPolyglot.export
.- Since:
- 19.2
- See Also:
-
denyBindingsAccess
Denies access to polyglot bindings for a language. The provided language must not benull
.- Since:
- 19.2
- See Also:
-
build
Creates an instance of the custom polyglot access configuration. This method may be called multiple times to create more than one independent instances.- Since:
- 19.2
-