Class CodeHTML


  • final class CodeHTML
    extends java.lang.Object
    Convert code into HTML file.
    • Constructor Summary

      Constructors 
      Constructor Description
      CodeHTML​(java.lang.String dir, java.lang.String className, Method[] methods, ConstantPool constantPool, ConstantHTML constantHtml, java.nio.charset.Charset charset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String codeToHTML​(ByteSequence bytes, int methodNumber)
      Disassemble a stream of byte codes and return the string representation.
      private void findGotos​(ByteSequence bytes, Code code)
      Find all target addresses in code, so that they can be marked with <A NAME = ...>.
      private void writeMethod​(Method method, int methodNumber)
      Write a single method with the byte code associated with it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • wide

        private static boolean wide
      • className

        private final java.lang.String className
      • printWriter

        private final java.io.PrintWriter printWriter
      • gotoSet

        private java.util.BitSet gotoSet
    • Constructor Detail

      • CodeHTML

        CodeHTML​(java.lang.String dir,
                 java.lang.String className,
                 Method[] methods,
                 ConstantPool constantPool,
                 ConstantHTML constantHtml,
                 java.nio.charset.Charset charset)
          throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • codeToHTML

        private java.lang.String codeToHTML​(ByteSequence bytes,
                                            int methodNumber)
                                     throws java.io.IOException
        Disassemble a stream of byte codes and return the string representation.
        Parameters:
        stream - data input stream
        Returns:
        String representation of byte code
        Throws:
        java.io.IOException
      • findGotos

        private void findGotos​(ByteSequence bytes,
                               Code code)
                        throws java.io.IOException
        Find all target addresses in code, so that they can be marked with <A NAME = ...>. Target addresses are kept in an BitSet object.
        Throws:
        java.io.IOException
      • writeMethod

        private void writeMethod​(Method method,
                                 int methodNumber)
                          throws java.io.IOException
        Write a single method with the byte code associated with it.
        Throws:
        java.io.IOException