本文整理汇总了Java中com.intellij.openapi.module.LanguageLevelUtil.getEffectiveLanguageLevel方法的典型用法代码示例。如果您正苦于以下问题:Java LanguageLevelUtil.getEffectiveLanguageLevel方法的具体用法?Java LanguageLevelUtil.getEffectiveLanguageLevel怎么用?Java LanguageLevelUtil.getEffectiveLanguageLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.module.LanguageLevelUtil
的用法示例。
在下文中一共展示了LanguageLevelUtil.getEffectiveLanguageLevel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkComponentProperties
import com.intellij.openapi.module.LanguageLevelUtil; //导入方法依赖的package包/类
protected void checkComponentProperties(Module module, final IComponent component, final FormErrorCollector collector) {
final GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
final PsiManager psiManager = PsiManager.getInstance(module.getProject());
final PsiClass aClass = JavaPsiFacade.getInstance(psiManager.getProject()).findClass(component.getComponentClassName(), scope);
if (aClass == null) {
return;
}
for(final IProperty prop: component.getModifiedProperties()) {
final PsiMethod getter = PropertyUtil.findPropertyGetter(aClass, prop.getName(), false, true);
if (getter == null) continue;
final LanguageLevel languageLevel = LanguageLevelUtil.getEffectiveLanguageLevel(module);
if (Java15APIUsageInspection.isForbiddenApiUsage(getter, languageLevel)) {
registerError(component, collector, prop, "@since " + Java15APIUsageInspection.getShortName(languageLevel));
}
}
}
示例2: getLanguageLevelInner
import com.intellij.openapi.module.LanguageLevelUtil; //导入方法依赖的package包/类
private static LanguageLevel getLanguageLevelInner(@NotNull PsiDirectory dir) {
final VirtualFile virtualFile = dir.getVirtualFile();
final Project project = dir.getProject();
final Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(virtualFile);
if (module != null) {
return LanguageLevelUtil.getEffectiveLanguageLevel(module);
}
return LanguageLevelProjectExtension.getInstance(project).getLanguageLevel();
}
示例3: getImmediateValue
import com.intellij.openapi.module.LanguageLevelUtil; //导入方法依赖的package包/类
@Override
public LanguageLevel getImmediateValue(@NotNull Module module) {
return LanguageLevelUtil.getEffectiveLanguageLevel(module);
}
示例4: getLanguageLevel
import com.intellij.openapi.module.LanguageLevelUtil; //导入方法依赖的package包/类
public LanguageLevel getLanguageLevel() {
return LanguageLevelUtil.getEffectiveLanguageLevel(getNodes().iterator().next());
}