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:
between two or just
for one 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 called Polyglot.eval.
polyglot
bindings. The names of the guest language builtins to access polyglot bindings are language
specific. In JavaScript they are called Polyglot.import and
Polyglot.export.
ALL is used. In this mode polyglot evaluation builtins are available even if there is
just one installed language available.
| Modifier and Type | Class and Description |
|---|---|
| public class | PolyglotAccess.
A builder for a polyglot access configuration. |
| Modifier and Type | Field and Description |
|---|---|
| public static final PolyglotAccess | ALL
Provides guest languages full access to other languages using polyglot evaluation and binding builtins. |
| private final boolean | |
| private final EconomicSet | |
| private final EconomicMap | |
| public static final PolyglotAccess | NONE
Provides guest languages no access to other languages using polyglot builtins evaluation and binding builtins. |
| Access | Constructor and Description |
|---|---|
| pack-priv | PolyglotAccess(boolean allAccess, EconomicMap<String, EconomicSet<String>> access, EconomicSet<String> bindingsAccess)
|
| Modifier and Type | Method and Description |
|---|---|
| private static EconomicMap | |
| pack-priv Set | |
| pack-priv Set | |
| pack-priv Map | |
| public static PolyglotAccess. | |
| pack-priv static String | |
| pack-priv String |
| ALL | back to summary |
|---|---|
| public static final PolyglotAccess ALL Provides guest languages full access to other languages using polyglot evaluation and binding builtins.
| |
| allAccess | back to summary |
|---|---|
| private final boolean allAccess | |
| bindingsAccess | back to summary |
|---|---|
| private final EconomicSet<String> bindingsAccess | |
| evalAccess | back to summary |
|---|---|
| private final EconomicMap<String, UnmodifiableEconomicSet<String>> evalAccess | |
| NONE | back to summary |
|---|---|
| public static final PolyglotAccess NONE Provides guest languages no access to other languages using polyglot builtins evaluation and binding builtins.
| |
| PolyglotAccess | back to summary |
|---|---|
| pack-priv PolyglotAccess(boolean allAccess, EconomicMap<String, EconomicSet<String>> access, EconomicSet<String> bindingsAccess) | |
| copyMap | back to summary |
|---|---|
| private static EconomicMap | |
| getBindingsAccess | back to summary |
|---|---|
| pack-priv Set | |
| getEvalAccess | back to summary |
|---|---|
| pack-priv Set | |
| getEvalAccess | back to summary |
|---|---|
| pack-priv Map | |
| newBuilder | back to summary |
|---|---|
| public static PolyglotAccess. Creates a new custom polyglot access configuration builder. A polyglot access builder starts with no access rights.
| |
| toStringSet | back to summary |
|---|---|
| pack-priv static String toStringSet(UnmodifiableEconomicSet<String> set) | |
| validate | back to summary |
|---|---|
| pack-priv String validate(Set<String> availableLanguages) | |
| Modifier and Type | Field and Description |
|---|---|
| private EconomicSet | |
| private EconomicMap |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PolyglotAccess. | |
| public PolyglotAccess. | |
| public PolyglotAccess. | allowEvalBetween(String... languages)
Allows bidirectional evaluation of code between the given languages. |
| public PolyglotAccess | |
| public PolyglotAccess. | |
| public PolyglotAccess. | |
| public PolyglotAccess. | denyEvalBetween(String... languages)
Denies bidirectional evaluation of code between the given languages. |
| bindingsAccess | back to summary |
|---|---|
| private EconomicSet<String> bindingsAccess | |
| evalAccess | back to summary |
|---|---|
| private EconomicMap<String, EconomicSet<String>> evalAccess | |
| Builder | back to summary |
|---|---|
| pack-priv Builder() | |
| allowBindingsAccess | back to summary |
|---|---|
| public PolyglotAccess. 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
| |
| allowEval | back to summary |
|---|---|
| public PolyglotAccess. 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.
| |
| allowEvalBetween | back to summary |
|---|---|
| public PolyglotAccess. Allows bidirectional evaluation of code between the given languages. When called with
language
| |
| build | back to summary |
|---|---|
| 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.
| |
| denyBindingsAccess | back to summary |
|---|---|
| public PolyglotAccess. Denies access to polyglot bindings for a language. The provided language must not be
| |
| denyEval | back to summary |
|---|---|
| public PolyglotAccess. 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.
| |
| denyEvalBetween | back to summary |
|---|---|
| public PolyglotAccess. Denies bidirectional evaluation of code between the given languages. When called with
language
| |