APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.bcel.internal.util

public Class Class2HTML

extends Object
Class Inheritance
Imports
java.io.File, .FileNotFoundException, .IOException, .PrintWriter, .UnsupportedEncodingException, java.nio.charset.Charset, .StandardCharsets, java.util.HashSet, .Set, com.sun.org.apache.bcel.internal.Const, com.sun.org.apache.bcel.internal.classfile.Attribute, .ClassParser, .ConstantPool, .JavaClass, .Method, .Utility

Read class file(s) and convert them into HTML files. Given a JavaClass object "class" that is in package "package" five files will be created in the specified directory.
  1. "package"."class".html as the main file which defines the frames for the following subfiles.
  2. "package"."class"_attributes.html contains all (known) attributes found in the file
  3. "package"."class"_cp.html contains the constant pool
  4. "package"."class"_code.html contains the byte code
  5. "package"."class"_methods.html contains references to all methods and fields of the class
All subfiles reference each other appropriately, e.g. clicking on a method in the Method's frame will jump to the appropriate method in the Code frame.

Field Summary

Modifier and TypeField and Description
private static final Set<String>
private static String
private static String
private static ConstantPool
private final String
private final JavaClass

Constructor Summary

AccessConstructor and Description
public
Class2HTML(final JavaClass
The class to write
javaClass
,
final String
The directory to put the files in
dir
)

Write contents of the given JavaClass into HTML files.

private
Class2HTML(final JavaClass javaClass, final String dir, final Charset charset)

Method Summary

Modifier and TypeMethod and Description
public static void
main(final String[] argv)

pack-priv static String
referenceClass(final int index)

Utility method that converts a class reference in the constant pool, i.e., an index to a string.

pack-priv static String
referenceType(final String type)

pack-priv static String
toHTML(final String str)

private void
writeMainHTML(final AttributeHTML attributeHtml, final Charset charset)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

basicTypesback to summary
private static final Set<String> basicTypes
classNameback to summary
private static String className
classPackageback to summary
private static String classPackage
constantPoolback to summary
private static ConstantPool constantPool
dirback to summary
private final String dir
javaClassback to summary
private final JavaClass javaClass

Constructor Detail

Class2HTMLback to summary
public Class2HTML(final JavaClass javaClass, final String dir) throws IOException

Write contents of the given JavaClass into HTML files.

Parameters
javaClass:JavaClass

The class to write

dir:String

The directory to put the files in

Exceptions
IOException:
Thrown when an I/O exception of some sort has occurred.
Class2HTMLback to summary
private Class2HTML(final JavaClass javaClass, final String dir, final Charset charset) throws IOException

Method Detail

mainback to summary
public static void main(final String[] argv) throws IOException
referenceClassback to summary
pack-priv static String referenceClass(final int index)

Utility method that converts a class reference in the constant pool, i.e., an index to a string.

referenceTypeback to summary
pack-priv static String referenceType(final String type)
toHTMLback to summary
pack-priv static String toHTML(final String str)
writeMainHTMLback to summary
private void writeMainHTML(final AttributeHTML attributeHtml, final Charset charset) throws FileNotFoundException, UnsupportedEncodingException