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


Java SourceVersion.RELEASE_6属性代码示例

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


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

示例1: resolveSourceVersion

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,代码行数:22,代码来源:JavadocUtilities.java

示例2: getSupportedSourceVersion

/**
 * If the processor class is annotated with {@link
 * SupportedSourceVersion}, return the source version in the
 * annotation.  If the class is not so annotated, {@link
 * SourceVersion#RELEASE_6} is returned.
 *
 * @return the latest source version supported by this processor
 */
public SourceVersion getSupportedSourceVersion() {
    SupportedSourceVersion ssv = this.getClass().getAnnotation(SupportedSourceVersion.class);
    SourceVersion sv = null;
    if (ssv == null) {
        sv = SourceVersion.RELEASE_6;
        if (isInitialized())
            processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING,
                                                     "No SupportedSourceVersion annotation " +
                                                     "found on " + this.getClass().getName() +
                                                     ", returning " + sv + ".");
    } else
        sv = ssv.value();
    return sv;
}
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:22,代码来源:AbstractProcessor.java

示例3: getSupportedSourceVersion

@Override
public SourceVersion getSupportedSourceVersion() {
    if (SourceVersion.latest().compareTo(SourceVersion.RELEASE_6) > 0)
        return SourceVersion.valueOf("RELEASE_7");
    else
        return SourceVersion.RELEASE_6;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:AnnotationParser.java

示例4: genTestObjectWildcard

/**
 * Generate an object to be used with the various wildcard pattern forms.
 * Explicitly supports only specific package wildcards with specific objects.
 * @param pattern a wildcard pattern ending in "*"
 * @param allowed a boolean indicating to generate the allowed or disallowed case
 * @return an object within or outside the wildcard
 */
static Object genTestObjectWildcard(String pattern, boolean allowed) {
    if (pattern.endsWith(".**")) {
        // package hierarchy wildcard
        if (pattern.startsWith("javax.lang.")) {
            return SourceVersion.RELEASE_5;
        }
        if (pattern.startsWith("java.")) {
            return 4;
        }
        if (pattern.startsWith("javax.")) {
            return SourceVersion.RELEASE_6;
        }
        return otherObject;
    } else if (pattern.endsWith(".*")) {
        // package wildcard
        if (pattern.startsWith("javax.lang.model")) {
            return SourceVersion.RELEASE_6;
        }
    } else {
        // class wildcard
        if (pattern.equals("*")) {
            return otherObject; // any object will do
        }
        if (pattern.startsWith("java.util.Hash")) {
            return new Hashtable<String, String>();
        }
    }
    Assert.fail("Object could not be generated for pattern: "
            + pattern
            + ", allowed: " + allowed);
    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:39,代码来源:SerialFilterTest.java

示例5: getSupportedSourceVersion

@Override
public SourceVersion getSupportedSourceVersion() {
    String sourceVersion = processingEnv.getOptions().get("SourceVersion");
    if (sourceVersion == null) {
        processingEnv.getMessager().printMessage(WARNING,
                                                 "No SourceVersion option given");
        return SourceVersion.RELEASE_6;
    } else {
        return SourceVersion.valueOf(sourceVersion);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:TestSourceVersionWarnings.java

示例6: getSupportedSourceVersion

@Override public SourceVersion getSupportedSourceVersion() {
    return SourceVersion.RELEASE_6;// SourceVersion.latestSupported();
}
 
开发者ID:LeeKyoungIl,项目名称:illuminati,代码行数:3,代码来源:IlluminatiProcessor.java


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