polyglot.types.reflect
Class ClassFileLazyClassInitializer

java.lang.Object
  extended by polyglot.types.reflect.ClassFileLazyClassInitializer
All Implemented Interfaces:
LazyClassInitializer, LazyInitializer

public class ClassFileLazyClassInitializer
extends java.lang.Object
implements LazyClassInitializer

ClassFile basically represents a Java classfile as it is found on disk. The classfile is modeled according to the Java Virtual Machine Specification. Methods are provided to edit the classfile at a very low level.

Author:
Nate Nystrom
See Also:
Attribute, Constant, Field, Method

Constructor Summary
ClassFileLazyClassInitializer(ClassFile file, TypeSystem ts)
           
 
Method Summary
 void canonicalConstructors()
          Initialize ct's constructors.
 void canonicalFields()
          Initialize ct's fields.
 void canonicalMethods()
          Initialize ct's methods.
 boolean fromClassFile()
          Return true if the class is from a class file.
 void initConstructors()
          Initialize ct's constructors.
 void initFields()
          Initialize ct's fields.
protected  boolean initialized()
           
 void initInterfaces()
          Initialize ct's interfaces.
 void initMemberClasses()
          Initialize ct's member classes.
 void initMethods()
          Initialize ct's methods.
 void initSuperclass()
          Initialize ct's superclass.
 void initTypeObject()
          Initialize the type object.
 boolean isTypeObjectInitialized()
          Return true if initTypeObject has been called.
 Position position()
          Create a position for the class file.
 void setClass(ParsedClassType ct)
          Set the class type we're initializing.
 ParsedClassType type()
          Create the type for this class file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFileLazyClassInitializer

public ClassFileLazyClassInitializer(ClassFile file,
                                     TypeSystem ts)
Method Detail

setClass

public void setClass(ParsedClassType ct)
Description copied from interface: LazyClassInitializer
Set the class type we're initializing.

Specified by:
setClass in interface LazyClassInitializer

fromClassFile

public boolean fromClassFile()
Description copied from interface: LazyClassInitializer
Return true if the class is from a class file.

Specified by:
fromClassFile in interface LazyClassInitializer

position

public Position position()
Create a position for the class file.


type

public ParsedClassType type()
                     throws SemanticException
Create the type for this class file.

Throws:
SemanticException

initTypeObject

public void initTypeObject()
Description copied from interface: LazyInitializer
Initialize the type object. This must be called once when the object is added to the root-level system resolver, but never before then.

Specified by:
initTypeObject in interface LazyInitializer

isTypeObjectInitialized

public boolean isTypeObjectInitialized()
Description copied from interface: LazyInitializer
Return true if initTypeObject has been called.

Specified by:
isTypeObjectInitialized in interface LazyInitializer

initSuperclass

public void initSuperclass()
Description copied from interface: LazyClassInitializer
Initialize ct's superclass. This method ensures the superclass of the class is initailized to a canonical type, or throws a MissingDependencyException.

Specified by:
initSuperclass in interface LazyClassInitializer

initInterfaces

public void initInterfaces()
Description copied from interface: LazyClassInitializer
Initialize ct's interfaces. This method ensures the interfaces of the class are initailized to canonical types, or throws a MissingDependencyException.

Specified by:
initInterfaces in interface LazyClassInitializer

initMemberClasses

public void initMemberClasses()
Description copied from interface: LazyClassInitializer
Initialize ct's member classes. This method ensures the member classes of the class are initailized to canonical types, or throws a MissingDependencyException.

Specified by:
initMemberClasses in interface LazyClassInitializer

canonicalFields

public void canonicalFields()
Description copied from interface: LazyClassInitializer
Initialize ct's fields. This method ensures the list of fields is populated with canonical FieldInstances, or throws a MissingDependencyException.

Specified by:
canonicalFields in interface LazyClassInitializer

canonicalMethods

public void canonicalMethods()
Description copied from interface: LazyClassInitializer
Initialize ct's methods. This method ensures the list of methods is populated with canonical MethodInstances, or throws a MissingDependencyException.

Specified by:
canonicalMethods in interface LazyClassInitializer

canonicalConstructors

public void canonicalConstructors()
Description copied from interface: LazyClassInitializer
Initialize ct's constructors. This method ensures the list of constructors is populated with canonical ConstructorInstances, or throws a MissingDependencyException.

Specified by:
canonicalConstructors in interface LazyClassInitializer

initFields

public void initFields()
Description copied from interface: LazyClassInitializer
Initialize ct's fields. This method ensures the list of fields is populated with (possibly non-canonical) FieldInstances, or throws a MissingDependencyException.

Specified by:
initFields in interface LazyClassInitializer

initMethods

public void initMethods()
Description copied from interface: LazyClassInitializer
Initialize ct's methods. This method ensures the list of fields is populated with (possibly non-canonical) MethodInstances, or throws a MissingDependencyException.

Specified by:
initMethods in interface LazyClassInitializer

initConstructors

public void initConstructors()
Description copied from interface: LazyClassInitializer
Initialize ct's constructors. This method ensures the list of fields is populated with (possibly non-canonical) ConstructorInstances, or throws a MissingDependencyException.

Specified by:
initConstructors in interface LazyClassInitializer

initialized

protected boolean initialized()