Article View: comp.lang.java.programmer
Article #326Java Class Inspector (with source code)
From: Wayne Kovsky
Date: Sun, 24 May 1998 00:00
Date: Sun, 24 May 1998 00:00
38 lines
3091 bytes
3091 bytes
I have just uploaded ClassInspector, a Java applet/application (it can be run as either), and its source code, to our Colorado Software Summit Web site (the URL is in my signature block). This application is of interest to Java programmers, since it provides a means for inspecting any Java class that is accessible to the Java Virtual Machine -- that is, any class that is defined in your CLASSPATH environment variable, and/or the directory from which ClassInspector was loaded. Indeed, you can use ClassInspector to inspect ClassInspector itself. When you provide the name of a Java class, ClassInspector uses the class introspection mechanism that was introduced with JDK 1.1 to produce a display of the class' constructors, methods and variables. Available options (via checkboxes) allow you to tailor the output so that it looks very much like the HTML documentation that is provided with the JDK. While this is interesting only as an academic exercise for the Java classes that are part of the JDK itself (since they are already documented), this program is particularly valuable for producing JDK-style documentation for classes that do not have adequate documentation and for which you do not have source code. An HTML page at the Web site describes ClassInspector in a bit more detail. To run it as an applet, you must have a browser that supports JDK 1.1 features (such as Netscape 4.04 with the JDK 1.1 patch applied, or the Beta version of Netscape 4.04 which already has that patch applied, or Internet Explorer 4). When run as an applet from our Web site, you will not be able to use some of ClassInspector's features, in particular you will not be able to inspect protected and private methods. If you download the source code and run it as a locally-loaded applet, or as an application, you will be able to inspect protected/private methods as well as public ones. Enjoy! -- Wayne Kovsky <wkovsky@SoftwareSummit.com> Colorado Software Summit (A Java Programming Conference) http://www.SoftwareSummit.com
Technical Details
Message-ID:
<3568A2F0.BDABC294@softwaresummit.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,b6347ff27efe7246,start X-Google-Attributes: gid1089d0,public X-Google-Thread: 112e38,b6347ff27efe7246,start X-Google-Attributes: gid112e38,public X-Google-Thread: 10a146,b6347ff27efe7246,start X-Google-Attributes: gid10a146,public X-Google-Thread: f5e83,b6347ff27efe7246,start X-Google-Attributes: gidf5e83,public From: Wayne Kovsky <wkovsky@softwaresummit.com> Subject: Java Class Inspector (with source code) Date: 1998/05/24 Message-ID: <3568A2F0.BDABC294@softwaresummit.com> X-Deja-AN: 356171052 Content-Transfer-Encoding: 7bit X-Notice: should be forwarded in their entirety to postmaster@ibm.net Content-Type: text/plain; charset=us-ascii X-Trace: 24 May 1998 23:44:40 GMT, 129.37.216.186 Organization: Colorado Software Summit (A Java Programming Conference) MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer,comp.lang.java.softwaretools,borland.public.jbuilder.java.api,symantec.support.devtools.windows.vcafe4java.Other