org.apache.bcel.util

Class CodeHTML

final class CodeHTML extends Object implements Constants

Convert code into HTML file.

Version: $Id: CodeHTML.java 386056 2006-03-15 11:31:56Z tcurdt $

Author: M. Dahm

Field Summary
Stringclass_name
ConstantHTMLconstant_html
ConstantPoolconstant_pool
PrintWriterfile
BitSetgoto_set
Method[]methods
static booleanwide
Constructor Summary
CodeHTML(String dir, String class_name, Method[] methods, ConstantPool constant_pool, ConstantHTML constant_html)
Method Summary
StringcodeToHTML(ByteSequence bytes, int method_number)
Disassemble a stream of byte codes and return the string representation.
voidfindGotos(ByteSequence bytes, Method method, Code code)
Find all target addresses in code, so that they can be marked with <A NAME = ...>.
voidwriteMethod(Method method, int method_number)
Write a single method with the byte code associated with it.

Field Detail

class_name

private String class_name

constant_html

private ConstantHTML constant_html

constant_pool

private ConstantPool constant_pool

file

private PrintWriter file

goto_set

private BitSet goto_set

methods

private Method[] methods

wide

private static boolean wide

Constructor Detail

CodeHTML

CodeHTML(String dir, String class_name, Method[] methods, ConstantPool constant_pool, ConstantHTML constant_html)

Method Detail

codeToHTML

private final String codeToHTML(ByteSequence bytes, int method_number)
Disassemble a stream of byte codes and return the string representation.

Parameters: stream data input stream

Returns: String representation of byte code

findGotos

private final void findGotos(ByteSequence bytes, Method method, Code code)
Find all target addresses in code, so that they can be marked with <A NAME = ...>. Target addresses are kept in an BitSet object.

writeMethod

private void writeMethod(Method method, int method_number)
Write a single method with the byte code associated with it.