Extracting JavaDoc documentation from source files using JavaParser

  A lot of people are using JavaParser for the most different goals. One of these is extracting documentation. In this short post we will see how you can print all the JavaDoc comments associated to classes or interfaces. Code is available on GitHub: Getting all the Javadoc comments for classes We are reusing DirExplorer, […]

Implementing Lexical Preservation for JavaParser

Many users of JavaParser are asking to implement lexical preservation, i.e., the ability of parsing a Java source file, modifying the AST and get back the modified Java source code keeping the original layout. Currently this is not supported by JavaParser: you can parse all Java 8 code with JavaParser, get an AST but then the […]

Observers for AST nodes in JavaParser

We are getting closer to the first Release Candidate for JavaParser 3.0. One of the last features we added was support for observing changes to all nodes of the Abstract Syntax Tree. While I wrote the code for this feature I received precious feedback from Danny van Bruggen (a.k.a. Matozoid) and Cruz Maximilien. So I […]

Getting Started with JavaParser

Getting started with JavaParser: analyzing Java Code programmatically

One of the things I like the most is to parse code and to perform automatic operations on it. For this reason I started contributing to JavaParser and created a couple of related projects: java-symbol-solver and effectivejava. As a contributor of JavaParser I read over and over some very similar questions about extracting information from Java source code. For this […]

Releasing JavaParser 2.1

Releasing JavaParser 2.1

The other day the guys involved in JavaParser left me the honor of releasing our new version: 2.1 The community on GitHub took over the project previously hosted on Google Code and abandoned at some point.

java comments parsing

Java comments parsing

Recently I have done some work on JavaParser, focusing on parsing comments and attributing them to the element being commented. I like working on manipulating source code. I like this problem also because it does not have obvious solutions, but it can be solved only relaying on heuristics and conventions. Some notes on comments parsing […]