ILanguageDiscoveryService¶
-
public interface
ILanguageDiscoveryService
¶ Interface for a language discovery service that finds and loads language components and implementations.
Methods¶
componentFromArchive¶
-
ILanguageComponent
componentFromArchive
(FileObject archiveFile)¶ Load a language component from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language component.
componentFromDirectory¶
-
ILanguageComponent
componentFromDirectory
(FileObject directory)¶ Load a language component from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language component.
discover¶
-
ILanguageComponent
discover
(ILanguageDiscoveryRequest request)¶ Discover language component with given request.
Parameters: - request – Language discovery request created by
request(FileObject)
.
Throws: - MetaborgException – When discovery fails unexpectedly.
Returns: Language components that were created.
- request – Language discovery request created by
discover¶
-
Iterable<ILanguageComponent>
discover
(Iterable<ILanguageDiscoveryRequest> requests)¶ Discover all language components with the given requests.
Parameters: - requests – Language discovery requests created by
request(FileObject)
.
Throws: - MetaborgException – When discovery fails unexpectedly.
Returns: Language components that were created.
- requests – Language discovery requests created by
languageFromArchive¶
-
ILanguageImpl
languageFromArchive
(FileObject archiveFile)¶ Load a language implementation from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails, or when more than one language implementation is loaded.
Returns: Loaded language implementation.
languageFromDirectory¶
-
ILanguageImpl
languageFromDirectory
(FileObject directory)¶ Load a language implementation from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails, or when more than one language implementation is loaded.
Returns: Loaded language implementation.
languagesFromArchive¶
-
Set<ILanguageImpl>
languagesFromArchive
(FileObject archiveFile)¶ Load language implementations from a ZIP archive file that contains a compiled language component.
Parameters: - archiveFile – ZIP archive file that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language implementations.
languagesFromDirectory¶
-
Set<ILanguageImpl>
languagesFromDirectory
(FileObject directory)¶ Load language implementations from a directory that contains a compiled language component.
Parameters: - directory – Directory that contains the compiled language component.
Throws: - MetaborgException – When loading the language component fails.
Returns: Loaded language implementations.
request¶
-
Iterable<ILanguageDiscoveryRequest>
request
(FileObject location)¶ Request language discovery at given location. Returns language discovery requests which can be checked for availability and errors. Pass requests to
discover(ILanguageDiscoveryRequest)
to actually load the components.Parameters: - location – The directory to search in.
Throws: - MetaborgException – When searching for language components fails unexpectedly.
Returns: Language discovery requests. Empty when no components can be discovered.
scanComponentsInDirectory¶
-
Set<ILanguageComponent>
scanComponentsInDirectory
(FileObject directory)¶ Scans given directory and all descendants for language components and loads them all.
Parameters: - directory – Directory to start scanning for language components.
Throws: - MetaborgException – When
directory
is not a directory or does not exist, when loading a language component fails, or when an unexpected I/O error occurs.
Returns: Loaded language components.
scanLanguagesInDirectory¶
-
Set<ILanguageImpl>
scanLanguagesInDirectory
(FileObject directory)¶ Scans given directory and all descendants for language components and loads them all.
Parameters: - directory – Directory to start scanning for language components.
Throws: - MetaborgException – When
directory
is not a directory or does not exist, when loading a language component fails, or when an unexpected I/O error occurs.
Returns: Loaded language implementations.