开发者

Insert "Last Modified" timestamp into javadoc footer

Is there a way to specify the last modified date of the class file? I'd like each javadoc page to have the last modified timestamp of the class file included, preferrably in the footer.

I thought I had done something like this some time ago, but can't开发者_JAVA百科 find any examples on the web, and the documentation for footer simply indicates that it can contain html. So can it not have any kind of place holder that will be set when the javadoc is generated?

Thanks.


Some source control systems allow you to code a marker that's updated when you commit the file. If you put that inside javadoc, the javadoc will tell you the revision number and when it was last committed.


I don't think this feature is available in javadoc. Why don't you rely on the source control to do this work for you? You can have, if SVN, defined keywords that will automatically be filled upon commit (see svn propset). This is much better and you don't need to worry about the javadoc processing.

If a simpler approach can satisfy, you may just add a script into the bottom option, like:

-bottom "<font size=\"-1\">Created by `echo $USER`, at `date +%Y-%m-%d\ %H:%M:%S.%N`.</font>"


I think it is the job of the editor to write the time stamp into the code. This is how Emacs does it:

package my.tuple;

/**
 * Implementation of an ordered 2-tuple.
 *
 * @date 2013-07-03
 */

public class Pair<A,B>
{
}

// Local Variables:
// time-stamp-pattern: "0/^ \\* @date %:y-%02m-%02d$"
// End:

After that the document processor can read the date. But the standard javadoc is not aware of dates. You need Eclipse or Doxygen for this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜