javadoc自定义标签 [英] javadoc custom tags

查看:107
本文介绍了javadoc自定义标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了将近一个小时,但找不到关于制作自定义标签的任何好信息.当我检查javadoc的帮助时,它说的是关于自定义标签的信息.

-标签<名称>:<位置>:<标头>

它没有定义任何东西.我认为名称将是标签的名称,而标头可能是您在生成javadoc时标签所显示的内容,但是位置是什么以及如何使用它?

名称,位置和标题也需要用引号引起来吗?

一些自定义标签的示例,也许对什么位置的解释可能对我有很大帮助.在创建Javadoc的这一特定部分上,我找不到任何好的教程.

解决方案

看起来您仅调用了javadoc -help.这只是有关这些选项的简短提醒,而不是完整的文档.

原则上,所有内容都在javadoc文档页面上进行了详细说明(对于 Windows Linux/Solaris ).

-tag选项用于添加自定义标记,而不需要创建自己的标记(需要使用标签头"

  • 标记名是自定义标记的名称-例如,如果您在源代码中写入@todo,则名称将为todo.
  • 中间参数是允许使用此标签的位置的标识符.这可以是a(无处不在),o(仅在概述页面中),p(在软件包文档中),t(对于类或接口文档),c(对于构造函数)的组合),m(对于方法),f(对于字段).另外,可以有一个X表示该标签已被接受,但未显示任何输出. (那么您就不需要 taghead 部分).
  • taghead 是应在生成的源中显示为标签标头的内容,例如我们的todo-tag的To Do:.

因此,如果@todo标签应随处可见并打印To Do:,则可以使用

-tag todo:a:"To Do:"

I've been googling for almost an hour and I can't find any good information on making custom tags. When I check the help for javadoc is says this about custom tags...

-tag < name >:< locations >:< header >

It does not define what any of things are. I think name would be the name of the tag and header is probably what the tag says when you generate the javadoc but what is locations and how is it used?

Also does the name, locations, and header need to be in quotes or anything like that?

A few examples of custom tags and maybe an explanation of what locations is would be a HUGE help for me. I can't find any good tutorials on this specific part of making a javadoc...

解决方案

Looks you have only invoked javadoc -help. This is only a short reminder about the options, not a complete documentation.

In principle, everything is explained in detail on the javadoc documentation page (for Windows and Linux/Solaris).

The -tag option is for adding custom tags to the standard doclet without having to create an own taglet (there you would use the -taglet option) or even an own doclet.

All the parameters to the option have to be one command line argument, so depending on your shell you usually have to put them (together or individually) in quotes if they contain any spaces.

-tag tagname:Xaoptcmf:"taghead"

  • The tagname is the name of your custom tag - for example, if you are writing @todo in the source, the name would be todo.
  • The middle parameter is an identifier for the locations where this tag is allowed. This can be a combination of a (everywhere), o (only in the overview page), p (on package documentation), t (for class or interface documentation), c (for constructors), m (for methods), f (for fields). Additionally there can be an X meaning the tag is accepted but no output shown. (Then you don't need the taghead part).
  • The taghead is what should be shown in the generated source as the header for your tag, for example To Do: for our todo-tag.

So, if you @todo tag should be allowed everywhere and print To Do:, you would use

-tag todo:a:"To Do:"

这篇关于javadoc自定义标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆