本文整理了Java中com.github.javaparser.JavaParser.getStaticConfiguration()
方法的一些代码示例,展示了JavaParser.getStaticConfiguration()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JavaParser.getStaticConfiguration()
方法的具体详情如下:
包路径:com.github.javaparser.JavaParser
类名称:JavaParser
方法名:getStaticConfiguration
暂无
代码示例来源:origin: gradle.plugin.ru.javasaw/javasaw
private ModuleDefinition parseModuleInfo(File moduleInfo) {
try {
ParserConfiguration.LanguageLevel languageLevel = JAVA_10;
JavaParser.getStaticConfiguration().setLanguageLevel(languageLevel); // todo to extension
LOGGER.debug("Parsing module info at language level " + languageLevel);
CompilationUnit compilationUnit = JavaParser.parse(String.join("\n", Files.readAllLines(moduleInfo.toPath())));
ModuleDeclaration moduleDeclaration = compilationUnit.getModule().orElseThrow(() -> new RuntimeException("can`t get module info metadata from parsing"));
List<ModuleRequiresStmt> list = moduleDeclaration.getModuleStmts().stream()
.filter(stms -> stms instanceof ModuleRequiresStmt).map(stms -> (ModuleRequiresStmt) stms)
.collect(Collectors.toList());
return new ModuleDefinition(moduleDeclaration.getNameAsString(), list);
} catch (IOException e) {
LOGGER.error("Catch error while parsing module info " + moduleInfo.getName(), e);
}
return null;
}
}
代码示例来源:origin: gradle.plugin.org.javamodularity/moduleplugin
Path moduleInfoJava = moduleInfoSrcDir.get().toPath().resolve("module-info.java");
try {
JavaParser.getStaticConfiguration().setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_11);
Optional<ModuleDeclaration> module = JavaParser.parse(moduleInfoJava).getModule();
if (module.isPresent()) {
代码示例来源:origin: Refactoring-Bot/Refactoring-Bot
JavaParser.getStaticConfiguration().setSymbolResolver(javaSymbolSolver);
代码示例来源:origin: Refactoring-Bot/Refactoring-Bot
JavaParser.getStaticConfiguration().setSymbolResolver(javaSymbolSolver);
内容来源于网络,如有侵权,请联系作者删除!