Click here to Skip to main content
15,885,546 members
Articles / Web Development / HTML

Java Class Viewer

Rate me:
Please Sign up or sign in to vote.
4.93/5 (41 votes)
21 Jun 2016MIT8 min read 178.2K   7.8K   96  
Watch the Java class file visually & interactively for the meaning of every byte
<html>
    <head>
        <!--
        
          @(#)package.html    April 11, 2009
        
        -->
    </head>
    <body>

        Parse a Java class file Byte Array, and provides a serious of friendly
        classes to get information from the parsed class file.


        <h2>Package Specification</h2>

        We start to use this package by constructing a
        {@link org.freeinternals.format.classfile.ClassFile} object from
        a byte java class byte array:

        <pre>
    byte[] classByteArray = ...
    ClassFile classfile = new ClassFile(classByteArray)
        </pre>

        and then, we can get various information from the class file:

        <pre>
    AccessFlags af = classfile.getAccessFlags();
    AbstractConstantPool[] cp = classfile.getConstantPool();
    FieldCount fc = classfile.getFieldCount();
    FieldInfo[] fi = classfile.getFields();
    MethodCount mc = classfile.getMethodCount();
    MethodInfo[] mi = classfile.getMethods();
    ...
        </pre>

        <h2>Related Documentation</h2>

        For overviews, tutorials, examples, guides, and tool documentation, please see:
        <ul>
            <li><a href="https://code.google.com/p/freeinternals/">https://code.google.com/p/freeinternals/</a>
            <li><a href="http://docs.oracle.com/javase/specs/">Java Language and Virtual Machine Specifications</a>
        </ul>

        <!-- Put @see and @since tags down here. -->
        @see org.freeinternals.format.classfile.ClassFile
        @since JDK 6.0
        @author Amos Shi

    </body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer
United States United States
Deliver useful software to the world.

Comments and Discussions