Is there a way to do a complete text search on the JAVA APIs?
ie: JavaTM 2 Platform, Standard Edition, v 1.4.2 API Specification
In other words, if i'm trying to find something in a comment area or trying to find every single reference to byte[], no matter where it's located, is there such a way?
I know that i can copy 1 particular class html to a text file and do a search on that, so maybe there's a way to copy the whole API document to a text file and do a search?
To search for a method-name (including constructors) I wrote a shell script find_java_method.sh which has to be invoked with the name of the method, i.e.:
Feel free to adapt it to your needs. Grep and especially sed aren't standard-tools on the win-plattforms, but freely available.
And this is find_java_method.sed, to remove html-tags from output:
[ August 06, 2004: Message edited by: Stefan Wagner ]
[ August 06, 2004: Message edited by: Stefan Wagner ] [ August 06, 2004: Message edited by: Stefan Wagner ]
Well for instance, right now i'm trying to find out how to handle HEX values and don't have an idea which class to use, so i'd like to do a complete search on the API to find every reference to the HEX word in the API listing!
I may get back alot of finds, but i can probably get an idea which classes to go and check into!
will return every token containing some kind of 'Hex', including 'TouchExpand...'. This will be problematic, if your search contains some html-token, included in every java-page. But in the other cases it will do a fast and easy rough impression.
If you use sed, you may clean up the output as shown above.
My results:
[ August 09, 2004: Message edited by: Stefan Wagner ] [ August 09, 2004: Message edited by: Stefan Wagner ]
bob connolly
Ranch Hand
Joined: Mar 10, 2004
Posts: 204
posted
0
Thanks Stefan!
This is exactly what i'm looking for!
I looked too complex initially, but now i understand what your doing!
I'm still mystified why the regular APIs dont' have such a capability!
Take care Stefan, das is good!
Julian Kennedy
Ranch Hand
Joined: Aug 02, 2004
Posts: 823
posted
0
Sun does provide this search page for developers but it's not as useful as it could be as I can't see an easy way to isolate one set of API docs. D'oh! :roll:
Jules
bob connolly
Ranch Hand
Joined: Mar 10, 2004
Posts: 204
posted
0
Works great Stefan!
I downloaded grep, very easy to run and it's free!
This is what i've been looking for YEARS! and i'm going to write a script to process the output, but absolutely ASTONISHED! this capability is not in the JAVADOC search!
The follwoing command printed out the file names and number of "finds" per file:
.\lang\Integer.html:<META NAME="keywords" CONTENT="toHexString()"> .\lang\Integer.html:<TD><CODE><B><A HREF="../../java/lang/Integer.html#toHexStr ng(int)">toHexString</A></B>(int i)</CODE> .\lang\Integer.html: the digits for hexadecimal (radix 16) are .\lang\Integer.html:<A NAME="toHexString(int)"><!-- --></A><H3> .\lang\Integer.html:toHexString</H3> .\lang\Integer.html ublic static <A HREF="../../java/lang/String.html" title=" lass in java.lang">String</A> <B>toHexString</B>(int i)</PRE> .\lang\Integer.html: in hexadecimal (base 16) with no extra leading .\lang\Integer.html: hexadecimal digits: .\lang\Integer.html: Integer.toHexString(n).toUpperCase() .\lang\Integer.html: represented by the argument in hexadecimal (base& bsp;16).<DT><B>Since:</B></DT> .\lang\Integer.html: hexadecimal integer exactly as by the method .\lang\Integer.html: Accepts decimal, hexadecimal, and octal numbers given .\lang\Integer.html: <dd><i>Sign<sub>opt</sub></i> <code>0x</code> <i>HexDigits /i> .\lang\Integer.html: <dd><i>Sign<sub>opt</sub></i> <code>0X</code> <i>HexDigits /i> .\lang\Integer.html: <dd><i>Sign<sub>opt</sub></i> <code>#</code> <i>HexDigits< i> .\lang\Integer.html: <i>DecimalNumeral</i>, <i>HexDigits</i>, and <i>OctalDigit </i> .\lang\Long.html:<META NAME="keywords" CONTENT="toHexString()"> .\lang\Long.html:<TD><CODE><B><A HREF="../../java/lang/Long.html#toHexString(lo g)">toHexString</A></B>(long i)</CODE> .\lang\Long.html: the digits for hexadecimal (radix 16) are .\lang\Long.html:<A NAME="toHexString(long)"><!-- --></A><H3> .\lang\Long.html:toHexString</H3> .\lang\Long.html ublic static <A HREF="../../java/lang/String.html" title="cla s in java.lang">String</A> <B>toHexString</B>(long i)</PRE> .\lang\Long.html: ASCII digits in hexadecimal (base 16) with no extra .\lang\Long.html: hexadecimal digits: .\lang\Long.html: Long.toHexString(n).toUpperCase() .\lang\Long.html: value represented by the argument in hexadecim l .\lang\Long.html: Accepts decimal, hexadecimal, and octal numbers given by the .\lang\Long.html: <dd><i>Sign<sub>opt</sub></i> <code>0x</code> <i>HexDigits</i
.\lang\Long.html: <dd><i>Sign<sub>opt</sub></i> <code>#</code> <i>HexDigits</i> .\lang\Long.html: <i>DecimalNumeral</i>, <i>HexDigits</i>, and <i>OctalDigits</ > .\lang\Long.html: a minus sign, then the rest of it is parsed as a hexadecimal nteger .\lang\Object.html: the unsigned hexadecimal representation of the hash code of the .\lang\Object.html: getClass().getName() + '@' + Integer.toHexString(hashCode()
.\lang\RuntimeException.html:<DT><B>Direct Known Subclasses:</B> <DD><A HREF=".
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.