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


Java LanguageLevel.JDK_1_3属性代码示例

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


在下文中一共展示了LanguageLevel.JDK_1_3属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:JavaLanguageLevelSection.java

示例2: 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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ClsParsingUtil.java

示例3: migrateFromIdea7

private static LanguageLevel migrateFromIdea7(Element element) {
  final boolean assertKeyword = Boolean.valueOf(element.getAttributeValue(ASSERT_KEYWORD_ATTR)).booleanValue();
  final boolean jdk15 = Boolean.valueOf(element.getAttributeValue(JDK_15_ATTR)).booleanValue();
  if (jdk15) {
    return LanguageLevel.JDK_1_5;
  }
  else if (assertKeyword) {
    return LanguageLevel.JDK_1_4;
  }
  else {
    return LanguageLevel.JDK_1_3;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:LanguageLevelProjectExtensionImpl.java

示例4: 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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:CompilerUtil.java

示例5: getLanguageLevel

@Override
protected LanguageLevel getLanguageLevel() {
  return LanguageLevel.JDK_1_3;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:SuppressLocalInspectionTest.java


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