use of com.github.javaparser.ParserConfiguration in project javaparser by javaparser.
the class JavaParserAPIIntegrationTest method annotationMemberDeclarationResolve.
@Test
public void annotationMemberDeclarationResolve() throws IOException {
File f = adaptPath(new File("src/test/resources/Annotations.java.txt"));
ParserConfiguration parserConfiguration = new ParserConfiguration();
parserConfiguration.setSymbolResolver(new JavaSymbolSolver(typeSolver));
CompilationUnit cu = new JavaParser(parserConfiguration).parse(ParseStart.COMPILATION_UNIT, new StreamProvider(new FileInputStream(f))).getResult().get();
AnnotationDeclaration declaration = (AnnotationDeclaration) cu.getType(2);
assertEquals("MyAnnotationWithFields", declaration.getNameAsString());
AnnotationMemberDeclaration memberDeclaration = (AnnotationMemberDeclaration) declaration.getMember(0);
ResolvedAnnotationMemberDeclaration resolvedDeclaration = memberDeclaration.resolve();
}
Aggregations