本文整理汇总了Java中com.intellij.pom.java.LanguageLevel.JDK_1_6属性的典型用法代码示例。如果您正苦于以下问题:Java LanguageLevel.JDK_1_6属性的具体用法?Java LanguageLevel.JDK_1_6怎么用?Java LanguageLevel.JDK_1_6使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.pom.java.LanguageLevel
的用法示例。
在下文中一共展示了LanguageLevel.JDK_1_6属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLanguageLevel
@Nullable
private static LanguageLevel getLanguageLevel(
Integer level, @Nullable LanguageLevel defaultValue) {
switch (level) {
case 3:
return LanguageLevel.JDK_1_3;
case 4:
return LanguageLevel.JDK_1_4;
case 5:
return LanguageLevel.JDK_1_5;
case 6:
return LanguageLevel.JDK_1_6;
case 7:
return LanguageLevel.JDK_1_7;
case 8:
return LanguageLevel.JDK_1_8;
case 9:
return LanguageLevel.JDK_1_9;
default:
return defaultValue;
}
}
示例2: getLanguageLevelFromToolchain
private static LanguageLevel getLanguageLevelFromToolchain(
BlazeProjectData blazeProjectData, LanguageLevel defaultLanguageLevel) {
BlazeJavaSyncData blazeJavaSyncData = blazeProjectData.syncState.get(BlazeJavaSyncData.class);
if (blazeJavaSyncData != null) {
String sourceVersion = blazeJavaSyncData.importResult.sourceVersion;
if (!Strings.isNullOrEmpty(sourceVersion)) {
switch (sourceVersion) {
case "6":
return LanguageLevel.JDK_1_6;
case "7":
return LanguageLevel.JDK_1_7;
case "8":
return LanguageLevel.JDK_1_8;
case "9":
return LanguageLevel.JDK_1_9;
}
}
}
return defaultLanguageLevel;
}
示例3: getLanguageLevelByVersion
@Nullable
public static LanguageLevel getLanguageLevelByVersion(int major) {
switch (major) {
case Opcodes.V1_1:
case 45: // other variant of 1.1
case Opcodes.V1_2:
case Opcodes.V1_3:
return LanguageLevel.JDK_1_3;
case Opcodes.V1_4:
return LanguageLevel.JDK_1_4;
case Opcodes.V1_5:
return LanguageLevel.JDK_1_5;
case Opcodes.V1_6:
return LanguageLevel.JDK_1_6;
case Opcodes.V1_7:
return LanguageLevel.JDK_1_7;
case Opcodes.V1_8:
return LanguageLevel.JDK_1_8;
default:
return null;
}
}
示例4: setUp
@Override
protected void setUp() throws Exception {
super.setUp();
myLanguageLevel = LanguageLevel.JDK_1_6;
getProject().registerService(LanguageLevelProjectExtension.class, new LanguageLevelProjectExtensionImpl(getProject()));
addExplicitExtension(LanguageASTFactory.INSTANCE, JavaLanguage.INSTANCE, new JavaASTFactory());
}
示例5: getApplicableLanguageLevel
@NotNull
public static LanguageLevel getApplicableLanguageLevel(String versionString, @NotNull LanguageLevel languageLevel) {
final boolean is8OrNewer = isOfVersion(versionString, "1.8") || isOfVersion(versionString, "8.0");
final boolean is7OrNewer = is8OrNewer || isOfVersion(versionString, "1.7") || isOfVersion(versionString, "7.0");
final boolean is6OrNewer = is7OrNewer || isOfVersion(versionString, "1.6") || isOfVersion(versionString, "6.0");
final boolean is5OrNewer = is6OrNewer || isOfVersion(versionString, "1.5") || isOfVersion(versionString, "5.0");
final boolean is4OrNewer = is5OrNewer || isOfVersion(versionString, "1.4");
final boolean is3OrNewer = is4OrNewer || isOfVersion(versionString, "1.3");
final boolean is2OrNewer = is3OrNewer || isOfVersion(versionString, "1.2");
final boolean is1OrNewer = is2OrNewer || isOfVersion(versionString, "1.0") || isOfVersion(versionString, "1.1");
if (!is1OrNewer) {
// unknown jdk version, cannot say anything about the corresponding language level, so leave it unchanged
return languageLevel;
}
// now correct the language level to be not higher than jdk used to compile
if (LanguageLevel.JDK_1_8.equals(languageLevel) && !is8OrNewer) {
languageLevel = LanguageLevel.JDK_1_7;
}
if (LanguageLevel.JDK_1_7.equals(languageLevel) && !is7OrNewer) {
languageLevel = LanguageLevel.JDK_1_6;
}
if (LanguageLevel.JDK_1_6.equals(languageLevel) && !is6OrNewer) {
languageLevel = LanguageLevel.JDK_1_5;
}
if (LanguageLevel.JDK_1_5.equals(languageLevel) && !is5OrNewer) {
languageLevel = LanguageLevel.JDK_1_4;
}
if (LanguageLevel.JDK_1_4.equals(languageLevel) && !is4OrNewer) {
languageLevel = LanguageLevel.JDK_1_3;
}
return languageLevel;
}
示例6: getLanguageLevel
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_1_6;
}