Top Description Fields Constructors Methods
org.graalvm.polyglot

public final Class Language

extends Object
Class Inheritance
Imports
java.util.Set, org.graalvm.options.OptionDescriptor, .OptionDescriptors, org.graalvm.polyglot.impl.AbstractPolyglotImpl.AbstractLanguageDispatch

A handle for a Graal language installed in an engine. The handle provides access to the language's meta-data, including the language's id, name, version and options.
Since
19.0
See Also
Engine#getLanguages()

Field Summary

Modifier and TypeField and Description
pack-priv final AbstractPolyglotImpl.AbstractLanguageDispatch
pack-priv final Object

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String
getDefaultMimeType()

Returns the default MIME type that is in use by a language.

public String

Returns:

a language ID string.
getId
()

Gets the primary identification string of this language.

public String
getImplementationName()

Gets a human-readable name of the language implementation (for example, "Graal.JS").

public Set<String>
getMimeTypes()

Returns the MIME types supported by this language.

public String

Returns:

the user-friendly name for this language.
getName
()

Gets a human-readable name for the language (for example, "JavaScript").

public OptionDescriptors
getOptions()

Returns the set of options provided by this language.

public String
getVersion()

Gets the version information of the language in an arbitrary language-specific format.

public String
getWebsite()

Get the URL for the language website.

public boolean
isInteractive()

Returns true if a the language is suitable for interactive evaluation of sources.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dispatchback to summary
pack-priv final AbstractPolyglotImpl.AbstractLanguageDispatch dispatch
receiverback to summary
pack-priv final Object receiver

Constructor Detail

Languageback to summary
pack-priv Language(AbstractPolyglotImpl.AbstractLanguageDispatch dispatch, Object receiver)

Method Detail

getDefaultMimeTypeback to summary
public String getDefaultMimeType()

Returns the default MIME type that is in use by a language. The default MIME type specifies whether a source is loaded as character or binary based source by default. Returns null if the language does not specify a default MIME type.

Since
19.0
See Also
Source#hasBytes(), Source#getMimeType()
getIdback to summary
public String getId()

Gets the primary identification string of this language. The language id is used as the primary way of identifying languages in the polyglot API. (eg. js)

Returns:String

a language ID string.

Since
19.0
getImplementationNameback to summary
public String getImplementationName()

Gets a human-readable name of the language implementation (for example, "Graal.JS"). Returns null if no implementation name was specified.

Since
19.0
getMimeTypesback to summary
public Set<String> getMimeTypes()

Returns the MIME types supported by this language.

Since
19.0
See Also
Source#getMimeType()
getNameback to summary
public String getName()

Gets a human-readable name for the language (for example, "JavaScript").

Returns:String

the user-friendly name for this language.

Since
19.0
getOptionsback to summary
public OptionDescriptors getOptions()

Returns the set of options provided by this language. Option values for languages can either be provided while building an engine or a context. The option descriptor name must be used as the option name.

Since
19.0
getVersionback to summary
public String getVersion()

Gets the version information of the language in an arbitrary language-specific format.

Since
19.0
getWebsiteback to summary
public String getWebsite()

Get the URL for the language website.

Since
21.1.0
isInteractiveback to summary
public boolean isInteractive()

Returns true if a the language is suitable for interactive evaluation of sources. Interactive languages should be displayed in interactive environments and presented to the user.

Since
19.0