Component: Class Viewer (public-API quick reference)
Status: ✅ Released 6.0.0 (maintenance / packaging refresh; no new features)
Last Updated: August 26, 2026
Author: jstevh
Class Viewer is a lightweight, stateless Java desktop tool for looking at the public surface of a class: methods, constructors, fields, superclass, and interfaces. It is not a decompiler and not an IDE. It uses reflection, a small Swing UI, and an editable XML config to jump from a listed method to JavaDocs in a browser, or to local source in a text editor.
On SourceForge since February 2004. Current packaged entry point: com.jstevh.viewer.ClassViewer.
java.lang.reflect exposes as public members. It does not parse bytecode, reconstruct private implementation, or rewrite source.ClassViewerConfig.xml beside the working directory. Restart to pick up config edits.com.jstevh.viewer and com.jstevh.tools.User / CLI argument
│
▼
┌───────────────────────────────────────┐
│ ClassViewer │
│ Swing UI + main + launch helpers │
│ VERSION = 6.0.0 │
└───────────────┬───────────────────────┘
│
┌───────┴────────┐
▼ ▼
┌───────────────┐ ┌─────────────────────┐
│ DirManager │ │ ClassInfo │
│ + SAXDirParser│ │ java.lang.reflect │
│ reads XML │ │ load class │
└───────┬───────┘ │ list members │
│ │ search methods │
▼ └──────────┬──────────┘
ClassViewerConfig.xml │
Local: browser, editor ▼
Documentation groups StringTools / StringList
│ method-name search
▼
Browser (JavaDocs URL) Editor (local source)
Runtime.exec launch optional line-number arg
| Class | Package | Role |
|---|---|---|
ClassViewer |
com.jstevh.viewer |
Main window, menus, font-size range, browser/editor launch, main |
ClassInfo |
com.jstevh.viewer |
Loads a class by name; lists public fields, methods, constructors, interfaces, superclass; method search |
DirManager |
com.jstevh.viewer |
Owns config load state; exposes package list, browser, editor, font preference |
SAXDirParser |
com.jstevh.viewer |
SAX parse of ClassViewerConfig.xml (DefaultHandler) |
MethodData |
com.jstevh.viewer |
Small interface: package, class, method name for a found method |
StringList |
com.jstevh.tools |
Minimal string collection used by config and search |
StringTools |
com.jstevh.tools |
searchStrings / removeStrings helpers for method search and signature cleanup |
java -jar ClassViewer-6.0.0.jar (or ClassViewer.bat on Windows), optionally with a class name argument such as java.lang.String.DirManager + SAXDirParser read ClassViewerConfig.xml from the directory the process was started in. Missing XML is a known failure mode: the app will not resolve packages or tools without that file beside the launch directory.ClassInfo calls Class.forName / reflection against the current classpath.ClassInfo.srchMethods + StringTools.Documentation/Group/Names mapcallBrowser opens the configured browser at the JavaDocs base URL<Local>Yes</Local>) and an editor is configured, the local file is opened<acceptsLineNumber>Yes</acceptsLineNumber>, the editor is invoked with the configured line-number parameter (gedit is the documented example)ClassViewerConfig.xml is the only user-facing configuration surface. It is ordinary XML and is meant to be edited in a text editor.
<Base>
<Local> browser, editor, line-number flag, font preference
<Documentation>
<Group> description, owner, web-or-local location, package names
Local block
BrowserLoc — executable used for JavaDocs (Windows 6.0.0 package: explorer.exe)Editor — executable used for local source (Windows 6.0.0 package: notepad.exe)acceptsLineNumber / parameter — whether the editor can be pointed at a lineLargerFonts — raises the default font and the allowed increase/decrease rangeDocumentation groups
java historically fall back to a default docs location when not listed.com.jstevh.viewer, com.jstevh.tools) as local.The JAR is platform-independent. Windows vs Linux packages differ in this XML and in the launcher script, not in the viewer classes.
Two supported ways to run, unchanged in spirit since the 5.x line:
| Mode | How | Why |
|---|---|---|
| Executable JAR | java -jar ClassViewer-6.0.0.jar or ClassViewer.bat |
Fast start; good for JDK classes already on the JRE |
| Unpacked | jar -xf ClassViewer-6.0.0.jar then run com.jstevh.viewer.ClassViewer with a real classpath |
Required to inspect your classes and third-party jars |
No installer is used or included. The app does not write back to the XML at runtime.
Kept small on purpose:
Font limits live as ClassViewer.MAX_FONT_SIZE / MIN_FONT_SIZE, seeded from the XML LargerFonts flag.
| Feature | Status | How it is implemented | Benefit |
|---|---|---|---|
| Public-only view | ✅ Done | ClassInfo via java.lang.reflect |
Fast, honest API picture; no decompiler drift |
| Method search | ✅ Done | srchMethods + StringTools.searchStrings |
Quick filter without leaving the tool |
| Superclass + interfaces | ✅ Done | ClassInfo.getSuperClassName / printInterfaces |
Immediate type-context |
| JavaDocs jump | ✅ Done | Package→group map + callBrowser |
Opens docs at the selected method when the URL scheme allows |
| Local source jump | ✅ Done | Local group + editor + optional line number | Same gesture for your own code |
| Editable config | ✅ Done | ClassViewerConfig.xml + SAXDirParser |
No rebuild to change browser, editor, or docs roots |
| Stateless | ✅ Done | No session files; XML is input only | Predictable; safe to copy the folder |
| Small artifact | ✅ Done | ~44 KB JAR; eight source files | Easy to audit and ship |
| Java 21 package verify | ✅ Done (6.0.0) | OpenJDK 21 compile + executable JAR | Current-runtime confidence |
| Java 8 runtime claim | ☐ Confirm separately | Source is still Java-era; 6.0.0 did not re-certify Java 8 | Avoid a false compatibility promise |
6.0.0 is a maintenance and packaging release. Functional behavior is the existing Class Viewer tool, not a new product.
Verified in the 6.0.0 package:
Main-Class: com.jstevh.viewer.ClassViewerClassViewerConfig.xml is well-formed and shipped beside the JARCOPYING, COPYING.LESSER), NOTICE, SHA256SUMS, README.md, RELEASE-NOTES.mdIntentionally out of scope for 6.0.0:
AccessControlException and Runtime.exec(String)this escape warningThose warnings still compile and package. They are recorded so a later cleanup pass can be honest about cost.
com.jstevh.viewer
ClassViewer.java UI + process launch
ClassInfo.java reflection model
DirManager.java config façade
SAXDirParser.java XML parse
MethodData.java found-method handle
com.jstevh.tools
StringList.java small list
StringTools.java search / strip helpers
Distribution (Windows 6.0.0 folder):
ClassViewer-6.0.0.jarClassViewerConfig.xmlClassViewer.batREADME.md, RELEASE-NOTES.md, NOTICECOPYING, COPYING.LESSERSHA256SUMSjavac -Xlint warnings (not a feature release)[[Home]]
[[Configuration Design]] (planned next)
This page is part of the Class Viewer design documentation. Written against the 6.0.0 SourceForge package (trunk assembled 2026-08-26). Project: https://sourceforge.net/projects/classviewer/