本文整理汇总了Java中com.intellij.pom.java.LanguageLevel.JDK_1_5属性的典型用法代码示例。如果您正苦于以下问题:Java LanguageLevel.JDK_1_5属性的具体用法?Java LanguageLevel.JDK_1_5怎么用?Java LanguageLevel.JDK_1_5使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.pom.java.LanguageLevel
的用法示例。
在下文中一共展示了LanguageLevel.JDK_1_5属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
}
示例2: createTraitClassType
@Nullable
public static GrTraitType createTraitClassType(@NotNull GrSafeCastExpression safeCastExpression) {
GrExpression operand = safeCastExpression.getOperand();
PsiType exprType = operand.getType();
if (!(exprType instanceof PsiClassType)) return null;
GrTypeElement typeElement = safeCastExpression.getCastTypeElement();
if (typeElement == null) return null;
PsiType type = typeElement.getType();
if (!GrTraitUtil.isTrait(PsiTypesUtil.getPsiClass(type))) return null;
return new GrTraitType(safeCastExpression, ((PsiClassType)exprType), Collections.singletonList((PsiClassType)type), safeCastExpression.getResolveScope(),
LanguageLevel.JDK_1_5);
}
示例3: 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;
}
示例4: create
public static GrMapType create(JavaPsiFacade facade,
GlobalSearchScope scope,
LinkedHashMap<String, PsiType> stringEntries,
List<Couple<PsiType>> otherEntries) {
return new GrMapTypeImpl(facade, scope, stringEntries, otherEntries, LanguageLevel.JDK_1_5);
}
示例5: GrTupleType
public GrTupleType(@NotNull GlobalSearchScope scope, @NotNull JavaPsiFacade facade) {
this(scope, facade, LanguageLevel.JDK_1_5);
}
示例6: getLanguageLevel
@Override
protected LanguageLevel getLanguageLevel() {
return LanguageLevel.JDK_1_5;
}
示例7: GrRangeType
public GrRangeType(GlobalSearchScope scope, JavaPsiFacade facade, @Nullable PsiType left, @Nullable PsiType right) {
this(LanguageLevel.JDK_1_5, scope, facade, left, right);
}
示例8: GrClassReferenceType
public GrClassReferenceType(GrReferenceElement referenceElement) {
super(LanguageLevel.JDK_1_5);
myReferenceElement = referenceElement;
}