Generate a JavaDoc comment I'm too lazy to write a JavaDoc comment myself, there's a lot of typing and it is mostly boilerplate. Write a program to generate a JavaDoc comment with $ as a placeholder given a method specification.

Example input:

Integer method(int arg1, String arg2) throws InvalidArgumentException, NullPointerException


Example output:

/**
    $
@param arg1 $
@param arg2 $
@return $
@throws InvalidArgumentException $
@throws NullPointerException $
*/


Some notes:


There won't be any static, private, or other qualifier on the method, just the return type.
There should be no @return tag if the return type is void.
It is possible that there won't be any throws clause.
You should accept the one-line method spec on stdin and write the result to stdout.


Shortest code wins.
PowerShell, 209 213
'/**
    $'
($i=&quot;$input&quot;)-replace'.*\( *| *\).*'-split','-ne''|%{&quot;@param $((-split$_)[1]) $&quot;}
,'@return $'*!($i-clike'void *')
if($i-match'\) *t'){$i-replace'.*\) *throws *'-split' *, *'|%{&quot;@throws $_ $&quot;}}'*/'

bash and PowerShell test scripts. but I'm probably missing a few cases still. But 22 tests are better than only one example, I guess :-)