In Netbeans when you type /**
above a method it generates a javadoc stub:
/**
*
* @param
* @return
*/
How do you customize the generated text? I would like a custom javadoc stub like:
/** Author = {author}
*
* My custom text
*
* @param
* @return
*/
Note: this is on a method, not the class which uses the class templates.
search terms: netbeans javadoc template stub custom autocomplete
This won't replace the functioning of /**
but it'll allow you an alternative.
Tools, Options
,Edit, Code Templates
tab,New
,jdt
for javadoc template),OK
,For example, if you put in this:
/**
* @author
*
* @param
* @return
*/
It'll output this:
/**
* @author
*
* @param @return
*/
But if you input this:
/**
* @author
*
* @param
*
* @return
*/
It'll output:
/**
* @author
*
* @param
*
* @return
*/
Kind of weird. Anyway, once you've typed that in, look at the Expand Template on: button and see if it is set on tab or enter or whatever. That part is your choice. However you want to activate the template. Click OK
.
In your document, go to where you want to insert your preformatted comment, and instead of typing /**
type in jdt
then do whatever the Expand template action was (tab, enter, etc) and your comment will appear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With