当前位置: 首页>>代码示例>>Java>>正文


Java SourceVersion.latest方法代码示例

本文整理汇总了Java中javax.lang.model.SourceVersion.latest方法的典型用法代码示例。如果您正苦于以下问题:Java SourceVersion.latest方法的具体用法?Java SourceVersion.latest怎么用?Java SourceVersion.latest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.lang.model.SourceVersion的用法示例。


在下文中一共展示了SourceVersion.latest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveSourceVersion

import javax.lang.model.SourceVersion; //导入方法依赖的package包/类
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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:JavadocUtilities.java

示例2: getSupportedSourceVersion

import javax.lang.model.SourceVersion; //导入方法依赖的package包/类
@Override
public SourceVersion getSupportedSourceVersion() {
    /*
     * Return latest source version instead of a fixed version
     * like RELEASE_9. 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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:CheckNamesProcessor.java

示例3: sourceVersion

import javax.lang.model.SourceVersion; //导入方法依赖的package包/类
public @NonNull SourceVersion sourceVersion() {
    String sourceLevel = SourceLevelQuery.getSourceLevel(ctx.getInfo().getFileObject());

    if (sourceLevel == null) {
        return SourceVersion.latest(); //TODO
    }

    String[] splited = sourceLevel.split("\\.");
    String   spec    = splited[1];

    return SourceVersion.valueOf("RELEASE_"+  spec);//!!!
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:Context.java

示例4: getSupportedSourceVersion

import javax.lang.model.SourceVersion; //导入方法依赖的package包/类
@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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:CheckNamesProcessor.java

示例5: getSupportedSourceVersion

import javax.lang.model.SourceVersion; //导入方法依赖的package包/类
@Override
public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.latest();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AddReadsTest.java


注:本文中的javax.lang.model.SourceVersion.latest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。