如何自定义 JAutodoc 模板
我刚刚开始使用 JAutodoc 这真的相当不错。我现在正在自定义输出,并想知道是否可以根据类型名称自定义类型注释。本质上,我希望为 JUnit 测试类(其类名全部以“Test...”开头)提供一个注释,并为非单元测试类提供另一种类型注释。是否可以有一个基于类名子字符串匹配的条件?基本伪代码是(注意,这不起作用):
/**
#if (${e.g(1)} startsWith 'Test')
* I'm a JUnit test
#else
* I'm not a JUnit test class
#end
*/
I've just starting using JAutodoc which is really rather nice. I'm now customizing the output and was wondering if its possible to customize the type comment based on the name of the type. Essentially, I'm looking to have one comment for JUnit test classess (whose class names all begin "Test...") and another type comment for non unit test classes. Is it possible to have a condition based on substring matching on the class name? Basic psuedo-code would be (note, this doesn't work):
/**
#if (${e.g(1)} startsWith 'Test')
* I'm a JUnit test
#else
* I'm not a JUnit test class
#end
*/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建一个新的类型模板。
名称:JUnit 测试
模式:测试(.+)
示例:TestMyClass
Create a new Type Template.
Name: JUnit Test
Pattern: Test(.+)
Example: TestMyClass