|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.types.reflect.ClassFileLazyClassInitializer
public class ClassFileLazyClassInitializer
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.
Attribute,
Constant,
Field,
Method| Field Summary | |
|---|---|
protected ClassFile |
clazz
|
protected boolean |
constructorsInitialized
|
protected ParsedClassType |
ct
|
protected boolean |
fieldsInitialized
|
protected boolean |
init
|
protected boolean |
interfacesInitialized
|
protected boolean |
memberClassesInitialized
|
protected boolean |
methodsInitialized
|
protected boolean |
superclassInitialized
|
protected TypeSystem |
ts
|
protected static java.util.Collection |
verbose
|
| Constructor Summary | |
|---|---|
ClassFileLazyClassInitializer(ClassFile file,
TypeSystem ts)
|
|
| Method Summary | |
|---|---|
protected Type |
arrayOf(Type t,
int dims)
Return an array type. |
void |
canonicalConstructors()
Initialize ct's constructors. |
void |
canonicalFields()
Initialize ct's fields. |
void |
canonicalMethods()
Initialize ct's methods. |
protected ConstructorInstance |
constructorInstance(Method method,
ClassType ct,
Field[] fields)
Create a ConstructorInstance. |
protected ParsedClassType |
createType()
Create the type for this class file. |
protected FieldInstance |
fieldInstance(Field field,
ClassType ct)
Create a FieldInstance. |
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. |
protected MethodInstance |
methodInstance(Method method,
ClassType ct)
Create a MethodInstance. |
Position |
position()
Create a position for the class file. |
protected ClassType |
quietTypeForName(java.lang.String name)
Looks up a class by name, assuming the class exists. |
void |
setClass(ParsedClassType ct)
Set the class type we're initializing. |
ParsedClassType |
type()
Create the type for this class file. |
protected ClassType |
typeForName(java.lang.String name)
Looks up a class by name. |
protected Type |
typeForString(java.lang.String str)
Return a type based on a JVM type descriptor string. |
protected java.util.List |
typeListForString(java.lang.String str)
Return a list of types based on a JVM type descriptor string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ClassFile clazz
protected TypeSystem ts
protected ParsedClassType ct
protected boolean init
protected boolean constructorsInitialized
protected boolean fieldsInitialized
protected boolean interfacesInitialized
protected boolean memberClassesInitialized
protected boolean methodsInitialized
protected boolean superclassInitialized
protected static java.util.Collection verbose
| Constructor Detail |
|---|
public ClassFileLazyClassInitializer(ClassFile file,
TypeSystem ts)
| Method Detail |
|---|
public void setClass(ParsedClassType ct)
LazyClassInitializer
setClass in interface LazyClassInitializerpublic boolean fromClassFile()
LazyClassInitializer
fromClassFile in interface LazyClassInitializerpublic Position position()
protected ParsedClassType createType()
throws SemanticException
SemanticException
public ParsedClassType type()
throws SemanticException
SemanticException
protected Type arrayOf(Type t,
int dims)
t - The array base type.dims - The number of dimensions of the array.
protected java.util.List typeListForString(java.lang.String str)
str - The type descriptor.
protected Type typeForString(java.lang.String str)
str - The type descriptor.
protected ClassType quietTypeForName(java.lang.String name)
name - Name of the class to find.
InternalCompilerError - if the class does not exist.
protected ClassType typeForName(java.lang.String name)
throws SemanticException
name - Name of the class to find.
SemanticException - if the class does not exist.public void initTypeObject()
LazyInitializer
initTypeObject in interface LazyInitializerpublic boolean isTypeObjectInitialized()
LazyInitializer
isTypeObjectInitialized in interface LazyInitializerpublic void initSuperclass()
LazyClassInitializerct's superclass.
This method ensures the superclass of the class is initailized to a
canonical type, or throws a MissingDependencyException.
initSuperclass in interface LazyClassInitializerpublic void initInterfaces()
LazyClassInitializerct's interfaces.
This method ensures the interfaces of the class are initailized to
canonical types, or throws a MissingDependencyException.
initInterfaces in interface LazyClassInitializerpublic void initMemberClasses()
LazyClassInitializerct's member classes.
This method ensures the member classes of the class are initailized to
canonical types, or throws a MissingDependencyException.
initMemberClasses in interface LazyClassInitializerpublic void canonicalFields()
LazyClassInitializerct's fields.
This method ensures the list of fields is populated with
canonical FieldInstances, or throws a MissingDependencyException.
canonicalFields in interface LazyClassInitializerpublic void canonicalMethods()
LazyClassInitializerct's methods.
This method ensures the list of methods is populated with
canonical MethodInstances, or throws a MissingDependencyException.
canonicalMethods in interface LazyClassInitializerpublic void canonicalConstructors()
LazyClassInitializerct's constructors.
This method ensures the list of constructors is populated with
canonical ConstructorInstances, or throws a MissingDependencyException.
canonicalConstructors in interface LazyClassInitializerpublic void initFields()
LazyClassInitializerct's fields.
This method ensures the list of fields is populated with (possibly
non-canonical) FieldInstances, or throws a MissingDependencyException.
initFields in interface LazyClassInitializerpublic void initMethods()
LazyClassInitializerct's methods.
This method ensures the list of fields is populated with (possibly
non-canonical) MethodInstances, or throws a MissingDependencyException.
initMethods in interface LazyClassInitializerpublic void initConstructors()
LazyClassInitializerct's constructors.
This method ensures the list of fields is populated with (possibly
non-canonical) ConstructorInstances, or throws a MissingDependencyException.
initConstructors in interface LazyClassInitializerprotected boolean initialized()
protected MethodInstance methodInstance(Method method,
ClassType ct)
method - The JVM Method data structure.ct - The class containing the method.
protected ConstructorInstance constructorInstance(Method method,
ClassType ct,
Field[] fields)
method - The JVM Method data structure for the constructor.ct - The class containing the method.fields - The constructor's fields, needed to remove parameters
passed to initialize synthetic fields.
protected FieldInstance fieldInstance(Field field,
ClassType ct)
field - The JVM Field data structure for the field.ct - The class containing the field.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||