Java API by
Zvi Har’El

cf
Class View

java.lang.Object
  extended by cf.ClassFile
      extended by cf.View

 class View
extends ClassFile

Class View views Java class files. This Java application is launched by the command

                java [-Dverbose] [-Dprint] cf.View [class] ...
 
where each class is given as a Java fully qualified class name or as a file name. If the file is a Java archive, all the class files in it are viewed. Unless the verbose system property is set, the constant pool is not viewed. If a Java Frame cannot be opened, or if the print system property is set, the classes are printed on the system standard output.

Note that when viewing Java 2 bootstrap classes, the oldjava launcher must be used.

Version:
$Id: View.java,v 1.61 2003/08/16 08:05:35 rl Exp $
Author:
Zvi Har’El
See Also:
Class source code

Nested Class Summary
 
Nested classes/interfaces inherited from class cf.ClassFile
ClassFile.ByteArray
 
Field Summary
private  StringBuffer buffer
           
private static Choice choice
           
private  short cPConstantValue
           
private  short cPExceptions
           
private  short cPInnerClasses
           
private  short cPLineNumberTable
           
private  short cPLocalVariableTable
           
private  short cPSourceFile
           
private static Cursor cursor
           
private static Frame frame
           
private static String[] newarray
           
private static String nl
           
private static PrintStream out
           
private static boolean print
           
private static TextArea text
           
private static boolean verbose
           
private static Hashtable views
           
 
Fields inherited from class cf.ClassFile
access, attributes, cP, cPCode, cPHash, fields, interfaces, major, methods, minor, superClass, thisClass
 
Constructor Summary
View()
          Constructor.
View(InputStream in)
          Constructor.
 
Method Summary
private  void escape(String s)
          Views a string using escape sequences.
private static int magic(String s)
           
static void main(String[] args)
           
(package private)  void print(String title, PrintStream out)
          Prints the class file.
(package private)  String view()
          Views the class file.
private  void view(byte[] b)
          Views an attribute.
private  void view(char v)
          Views a char.
private  void view(CodeAttribute ca)
          Views a code attribute.
private  int view(DataInputStream in, int pc)
          Views the byte code by reading it from an input stream.
private  void view(double v)
          Views a double.
private  void view(float v)
          Views a float.
private  void view(int v)
          Views a int.
private  void view(long v)
          Views a long.
private  void view(Long h)
          Views an exception handler.
private  void view(MemberInfo mi)
          Views a method or a field.
private  void view(short i)
          Views a constant.
private  void view(short i, boolean self)
          Views a constant recursively.
private  void view(String v)
          Views a string.
private static void viewText(String s)
           
 
Methods inherited from class cf.ClassFile
addInterface, cp, cp, cp, cp, cp, cp, cp, cp, desc, desc, findClassInPath, findUTF8, getBytes, getClassFile, readAttribute, renameClass, setName, setSuper, strip, toUTF8, write, write, writeAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newarray

private static final String[] newarray

nl

private static final String nl

out

private static final PrintStream out

print

private static final boolean print

verbose

private static final boolean verbose

choice

private static Choice choice

cursor

private static Cursor cursor

views

private static Hashtable views

frame

private static Frame frame

text

private static TextArea text

cPConstantValue

private final short cPConstantValue

cPExceptions

private final short cPExceptions

cPInnerClasses

private final short cPInnerClasses

cPLineNumberTable

private final short cPLineNumberTable

cPLocalVariableTable

private final short cPLocalVariableTable

cPSourceFile

private final short cPSourceFile

buffer

private StringBuffer buffer
Constructor Detail

View

View()
Constructor.


View

View(InputStream in)
throws IOException
Constructor.

Parameters:
in - an input stream
Throws:
IOException
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

viewText

private static void viewText(String s)

print

void print(String title,
           PrintStream out)
Prints the class file.


view

String view()
Views the class file.


view

private void view(short i)
Views a constant.

Parameters:
i - an index to the constant pool

view

private void view(short i,
                  boolean self)
Views a constant recursively.

Parameters:
i - an index to the constant pool
self - set for self call

view

private void view(String v)
Views a string.


view

private void view(char v)
Views a char.


view

private void view(int v)
Views a int.


view

private void view(long v)
Views a long.


view

private void view(float v)
Views a float.


view

private void view(double v)
Views a double.


escape

private void escape(String s)
Views a string using escape sequences.


view

private void view(MemberInfo mi)
Views a method or a field.

Parameters:
mi - the member

view

private void view(CodeAttribute ca)
Views a code attribute.

Parameters:
ca - the attribute

view

private void view(Long h)
Views an exception handler.

Parameters:
h - the handler

view

private void view(byte[] b)
Views an attribute.

Parameters:
b - the attribute

view

private int view(DataInputStream in,
                 int pc)
Views the byte code by reading it from an input stream.

Parameters:
in - the input stream
pc - the program counter

magic

private static int magic(String s)

Java API by
Zvi Har’El

Copyright © Zvi Har’El
$Date: 2007/10/15 13:50:30$