本文整理汇总了Java中com.intellij.pom.java.LanguageLevel.parse方法的典型用法代码示例。如果您正苦于以下问题:Java LanguageLevel.parse方法的具体用法?Java LanguageLevel.parse怎么用?Java LanguageLevel.parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.pom.java.LanguageLevel
的用法示例。
在下文中一共展示了LanguageLevel.parse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configLanguageLevel
import com.intellij.pom.java.LanguageLevel; //导入方法依赖的package包/类
private void configLanguageLevel() {
if ("false".equalsIgnoreCase(System.getProperty("idea.maven.configure.language.level"))) return;
LanguageLevel level = null;
Element cfg = myMavenProject.getPluginConfiguration("com.googlecode", "maven-idea-plugin");
if (cfg != null) {
level = MAVEN_IDEA_PLUGIN_LEVELS.get(cfg.getChildTextTrim("jdkLevel"));
}
if (level == null) {
level = LanguageLevel.parse(myMavenProject.getSourceLevel());
}
// default source and target settings of maven-compiler-plugin is 1.5, see details at http://maven.apache.org/plugins/maven-compiler-plugin
if (level == null) {
level = LanguageLevel.JDK_1_5;
}
myRootModelAdapter.setLanguageLevel(level);
}
示例2: getJavaLanguageLevel
import com.intellij.pom.java.LanguageLevel; //导入方法依赖的package包/类
@Nullable
public LanguageLevel getJavaLanguageLevel() {
if (myLanguageLevel != null) {
return LanguageLevel.parse(myLanguageLevel);
}
return null;
}
示例3: setLanguageLevel
import com.intellij.pom.java.LanguageLevel; //导入方法依赖的package包/类
public void setLanguageLevel(@Nullable String languageLevel) {
LanguageLevel level = LanguageLevel.parse(languageLevel);
if (level != null) {
myLanguageLevel = level;
}
}
示例4: getJavaLanguageLevel
import com.intellij.pom.java.LanguageLevel; //导入方法依赖的package包/类
@Nullable
public LanguageLevel getJavaLanguageLevel() {
JavaCompileOptions compileOptions = myDelegate.getJavaCompileOptions();
String sourceCompatibility = compileOptions.getSourceCompatibility();
return LanguageLevel.parse(sourceCompatibility);
}