com.sun.tools.classfile
Class ClassFile

java.lang.Object
  extended by com.sun.tools.classfile.ClassFile

public class ClassFile
extends java.lang.Object

See JVMS3, section 4.2.

This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.


Field Summary
 AccessFlags access_flags
           
 Attributes attributes
           
 ConstantPool constant_pool
           
 Field[] fields
           
 int[] interfaces
           
 int magic
           
 int major_version
           
 Method[] methods
           
 int minor_version
           
 int super_class
           
 int this_class
           
 
Constructor Summary
ClassFile(java.io.InputStream in, Attribute.Factory attributeFactory)
           
ClassFile(int magic, int minor_version, int major_version, ConstantPool constant_pool, AccessFlags access_flags, int this_class, int super_class, int[] interfaces, Field[] fields, Method[] methods, Attributes attributes)
           
 
Method Summary
 Attribute getAttribute(java.lang.String name)
           
 java.lang.String getInterfaceName(int i)
           
 java.lang.String getName()
           
 java.lang.String getSuperclassName()
           
 boolean isClass()
           
 boolean isInterface()
           
static ClassFile read(java.io.File file)
           
static ClassFile read(java.io.File file, Attribute.Factory attributeFactory)
           
static ClassFile read(java.io.InputStream in)
           
static ClassFile read(java.io.InputStream in, Attribute.Factory attributeFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

magic

public final int magic

minor_version

public final int minor_version

major_version

public final int major_version

constant_pool

public final ConstantPool constant_pool

access_flags

public final AccessFlags access_flags

this_class

public final int this_class

super_class

public final int super_class

interfaces

public final int[] interfaces

fields

public final Field[] fields

methods

public final Method[] methods

attributes

public final Attributes attributes
Constructor Detail

ClassFile

ClassFile(java.io.InputStream in,
          Attribute.Factory attributeFactory)
    throws java.io.IOException,
           ConstantPoolException
Throws:
java.io.IOException
ConstantPoolException

ClassFile

public ClassFile(int magic,
                 int minor_version,
                 int major_version,
                 ConstantPool constant_pool,
                 AccessFlags access_flags,
                 int this_class,
                 int super_class,
                 int[] interfaces,
                 Field[] fields,
                 Method[] methods,
                 Attributes attributes)
Method Detail

read

public static ClassFile read(java.io.File file)
                      throws java.io.IOException,
                             ConstantPoolException
Throws:
java.io.IOException
ConstantPoolException

read

public static ClassFile read(java.io.File file,
                             Attribute.Factory attributeFactory)
                      throws java.io.IOException,
                             ConstantPoolException
Throws:
java.io.IOException
ConstantPoolException

read

public static ClassFile read(java.io.InputStream in)
                      throws java.io.IOException,
                             ConstantPoolException
Throws:
java.io.IOException
ConstantPoolException

read

public static ClassFile read(java.io.InputStream in,
                             Attribute.Factory attributeFactory)
                      throws java.io.IOException,
                             ConstantPoolException
Throws:
java.io.IOException
ConstantPoolException

getName

public java.lang.String getName()
                         throws ConstantPoolException
Throws:
ConstantPoolException

getSuperclassName

public java.lang.String getSuperclassName()
                                   throws ConstantPoolException
Throws:
ConstantPoolException

getInterfaceName

public java.lang.String getInterfaceName(int i)
                                  throws ConstantPoolException
Throws:
ConstantPoolException

getAttribute

public Attribute getAttribute(java.lang.String name)

isClass

public boolean isClass()

isInterface

public boolean isInterface()