any way to let javadoc read comments from outside the source codes?

i am doing experiments on javadoc comments translation now. it's easy to extract the comments into some plain files, and, after some heavy labours of translations, how to put them back into the doc system?

in order to generate the doc tree, we need to run the javadoc tool. and currently javadoc reads comment lines from the source codes using the javac parser / scanner things. it seems silly to put the translation back into the source codes again, since they are internationalized strings, and there seems to be no standard on the encoding of java souce codes. so there must be a way to instruct javadoc to read comments directly from the plain text files.

is it easy?

seems there maybe 2 points we can hook in. first, the place the scanner reads the comment. second, the doclet uses the comment. i prefer the second one, which may means changing the constructors of various DocImpl classes or how the constructors are called. in either way, the document string from the source codes will be ignored and directly read from text files themselves. it won't be difficult to change the codes, but there should be a way to make this smarter, like a standard way of adding hooks. the comments may come from plain text files, or they may come from a database, or, even more funny, comes from the current System.in or other mysterious network sockets.

it seems a system level registered object can do this. looks like a glocal cookie handler.

more experiments will reveal more maybe.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blog has a comments managing system that requires me to approve each comment manually. Please do not re-post and I will reply it (if I have an answer) when I get pinged.

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today