Class PolyglotAccess.Builder

java.lang.Object
org.graalvm.polyglot.PolyglotAccess.Builder
Enclosing class:
PolyglotAccess

public final class PolyglotAccess.Builder extends Object
A builder for a polyglot access configuration. Builder instances are not thread-safe.
Since:
19.2
  • Method Details

    • allowEvalBetween

      public PolyglotAccess.Builder allowEvalBetween(String... languages)
      Allows bidirectional evaluation of code between the given languages. When called with language "A" and language "B", this is equivalent to calling allowEval("A", "B") and allowEval("B", "A"). If called with more than two then all language evaluation combinations will be allowed. This method potentially overrides already configured access rights with allowEval(String, String) or denyEval(String, String). The given language array must be null and individual languages must not be null.
      Since:
      19.2
      See Also:
    • denyEvalBetween

      public PolyglotAccess.Builder denyEvalBetween(String... languages)
      Denies bidirectional evaluation of code between the given languages. When called with language "A" and language "B", this is equivalent to calling denyEval("A", "B") and denyEval("B", "A"). If called with more than two then all language access combinations will be denied. This method potentially overrides already configured access rights with allowEval(String, String) or denyEval(String, String). The given language array must be null and individual languages must not be null.
      Since:
      19.2
      See Also:
    • allowEval

      public PolyglotAccess.Builder allowEval(String from, String to)
      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

      public PolyglotAccess.Builder denyEval(String from, String to)
      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

      public PolyglotAccess.Builder allowBindingsAccess(String language)
      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 called Polyglot.import and Polyglot.export.
      Since:
      19.2
      See Also:
    • denyBindingsAccess

      public PolyglotAccess.Builder denyBindingsAccess(String language)
      Denies access to polyglot bindings for a language. The provided language must not be null.
      Since:
      19.2
      See Also:
    • build

      public PolyglotAccess 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