Free your javadocs from generics

J

java

Hi all:

I remember when Java programming used to be fun and javadocs
where a new concept. Without getting into the pros/cons of
generics, here is how to remove generics from the javadocs
of jdk1.5. This in my opinion makes the javadocs a lot easier
to read and fun too (needless to say, if you *are* planning
to use generics, then this post is not for you).

The following gets about 99% of the clutter. Grep for (any perl
compatible engine will do) and replace the following with an
empty string (in the order shown). Note (1) comes before (2) etc.,
but each pattern in ONE group, say (1) can be seperated by | and
applied just once, so

a
b
c

can be applied as:

a|b|c

Step (1)
<E>
<K>
<V>
<T>
<K,V>
<[?]>

Step (2)
<a href="[^"]+" title="[^"]+">E</a>
<a href="[^"]+" title="[^"]+">Enum</a>
<a href="[^"]+" title="[^"]+">K</a>
<a href="[^"]+" title="[^"]+">V</a>
<a href="[^"]+" title="[^"]+">T</a>
<a href="[^"]+" title="[^"]+">Object</a>

Step (3)
&lt;,\? extends &gt;
&lt;\? extends ,\? extends &gt;
&lt;,&gt;&gt;
&lt;,&gt;
&lt;&gt;
,&gt;
&lt;.*?extends.*?&gt;&gt;
&lt;.*?extends.*?&gt;

Step (4)
&lt;<a href="[^"]+" title="[^"]+">E</a>&gt;

Step (5)
&lt;<[?] super T&gt;|&lt;[?] super &gt;
<a href="[^"]+" title="[^"]+">Object</a>

--j
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

generics puzzle 57
[ANN] XMLable 0.1.1 0
Problem with object 3
Problems getting text to show 3
I need help fixing my website 2
Generic generics help 7
How to make operation 0
Blue J Ciphertext Program 2

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top