views:

17

answers:

1

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
*/
+1  A: 

Create a new Type Template.

Name: JUnit Test
Pattern: Test(.+)
Example: TestMyClass

/**
 * I'm a JUnit test for ${e.g(1)}.
 */
Martin
Thanks Martin. And I'm going to guess that you are the same Martin who authored the tool, so huge +1 for that.
Chris Knight