public interface LanguageSupport
ServiceLoader.| Modifier and Type | Method and Description |
|---|---|
static Optional<LanguageSupport> |
getLanguageSupport(String extension)
Returns the
LanguageSupport implementation for the given file
extension. |
Set<String> |
getSupportedFileExtensions()
The set of supported file extensions.
|
static boolean |
isLanguageSupported(String extension)
Determines whether there exists a
LanguageSupport implementation for
the given extension. |
List<ImportStatement> |
parseImport(String importLine,
int lineNumber)
Extract the package names that this import statement represents.
|
Optional<String> |
parsePackage(String line)
Parses the given line and returns the declared package
|
static Optional<LanguageSupport> getLanguageSupport(String extension)
LanguageSupport implementation for the given file
extension.extension - The extension.LanguageSupport implementation or an empty optional
if none was found.static boolean isLanguageSupported(String extension)
LanguageSupport implementation for
the given extension.extension - The extension.Set<String> getSupportedFileExtensions()
Optional<String> parsePackage(String line)
line - Line in the source fileList<ImportStatement> parseImport(String importLine, int lineNumber)
e.g. import java.util.List; The above should return java.util.List in a Java source file.
importLine - Line in the source filelineNumber - The line number of the import.Copyright © 2014–2019. All rights reserved.