Java Code Examples for javax.lang.model.SourceVersion#latest()

The following examples show how to use javax.lang.model.SourceVersion#latest() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavadocUtilities.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public static SourceVersion resolveSourceVersion(FileObject file) {
    String sourceLevel = SourceLevelQuery.getSourceLevel(file);
    if (sourceLevel == null) {
        return SourceVersion.latest();
    } else if (sourceLevel.startsWith("1.6")) {
        return SourceVersion.RELEASE_6;
    } else if (sourceLevel.startsWith("1.5")) {
        return SourceVersion.RELEASE_5;
    } else if (sourceLevel.startsWith("1.4")) {
        return SourceVersion.RELEASE_4;
    } else if (sourceLevel.startsWith("1.3")) {
        return SourceVersion.RELEASE_3;
    } else if (sourceLevel.startsWith("1.2")) {
        return SourceVersion.RELEASE_2;
    } else if (sourceLevel.startsWith("1.1")) {
        return SourceVersion.RELEASE_1;
    } else if (sourceLevel.startsWith("1.0")) {
        return SourceVersion.RELEASE_0;
    }
    
    return SourceVersion.latest();
}
 
Example 2
Source File: CheckNamesProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    /*
     * Return latest source version instead of a fixed version
     * like RELEASE_8.  To return a fixed version, this class
     * could be annotated with a SupportedSourceVersion
     * annotation.
     *
     * Warnings will be issued if any unknown language constructs
     * are encountered.
     */
    return SourceVersion.latest();
}
 
Example 3
Source File: WebServiceAp.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 4
Source File: TestTrees.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 5
Source File: AnnotationProcessingWithModuleInfoInWrongPlace.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 6
Source File: T7068437.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 7
Source File: SingleModuleModeTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 8
Source File: T7068451.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 9
Source File: CompileModulePatchTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 10
Source File: JavahTask.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    // since this is co-bundled with javac, we can assume it supports
    // the latest source version
    return SourceVersion.latest();
}
 
Example 11
Source File: T6468404.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 12
Source File: T6421111.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 13
Source File: ServiceProviderProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 14
Source File: T7068437.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 15
Source File: T6421111.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 16
Source File: AnnoProcessor.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 17
Source File: AnnoProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 18
Source File: JavahTask.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    // since this is co-bundled with javac, we can assume it supports
    // the latest source version
    return SourceVersion.latest();
}
 
Example 19
Source File: AnnoProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
Example 20
Source File: T8076104.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}