public class SourceLevelQuery extends Object
SourceLevelQueryImplementation2
Modifier and Type | Class and Description |
---|---|
static class |
SourceLevelQuery.Profile
The JRE profiles defined by Java 8.
|
static class |
SourceLevelQuery.Result
Result of finding source level, encapsulating the answer as well as the
ability to listen to it.
|
Modifier and Type | Field and Description |
---|---|
static SpecificationVersion |
MINIMAL_SOURCE_LEVEL
The minimal supported source level.
|
Modifier and Type | Method and Description |
---|---|
static String |
getSourceLevel(FileObject javaFile)
Returns source level of the given Java file, Java package or source folder.
|
static SourceLevelQuery.Result |
getSourceLevel2(FileObject javaFile)
Returns a source level of the given Java file, Java package or source folder.
|
public static final SpecificationVersion MINIMAL_SOURCE_LEVEL
public static String getSourceLevel(FileObject javaFile)
-source
command line switch of
javac
compiler .javaFile
- Java source file, Java package or source folder in question@NonNull public static SourceLevelQuery.Result getSourceLevel2(@NonNull FileObject javaFile)
-source
command line switch of
javac
compiler .javaFile
- Java source file, Java package or source folder in questionSourceLevelQuery.Result
object encapsulating the source level of the Java file. Results created for source
levels provided by the SourceLevelQueryImplementation
do not support listening. Use SourceLevelQuery.Result.supportsChanges()
to check if the result supports listening.