ThaisaMirely / javaparser

Automatically exported from code.google.com/p/javaparser
0 stars 0 forks source link

Request: Complete parsning of JavaDoc #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is not a bug - but a request.

It would be nice, if parser also parsed javadoc into structured data.
The extension could be as simple as extending the JavadocComment class with
two methods:
1) public String getDescription()
   returns the description part of the javadoc
2) public Map<String, String> getTags()
   returns a LinkedHashMap (so that the order is preserved) containing a 
   attribute <-> value correlation.
   This map would could contain:
      key = "return"
      value = "The description of what is returned"

Original issue reported on code.google.com by aisz...@gmail.com on 7 Jan 2009 at 6:06

GoogleCodeExporter commented 9 years ago
To make the parser recognize javadoc syntax will be against of what the 
javaparser
should be.
I think javadoc should be parsed with a different parser, specific for it, as 
it has
a specific syntax.

I suggest to write a class to do operations with javadoc, the class could be 
called
"JavadocHelper" or something like this.

So, to get the "tags" inside the javadoc, you would do this:

JavadocHelper.getTags(javadocNode.getDescription());

What do you think about this solution?

Original comment by jges...@gmail.com on 9 Jan 2009 at 9:54

GoogleCodeExporter commented 9 years ago
I agreed - the solution you propose is definantly the cleanest way of doing it.

Original comment by aisz...@gmail.com on 10 Jan 2009 at 3:00

GoogleCodeExporter commented 9 years ago
I like this proposal too

Original comment by xal...@gmail.com on 18 Apr 2009 at 10:12