fr.umlv.corosol.component
Interface JClassLoader

All Superinterfaces:
JObject, JVMComponent
All Known Implementing Classes:
DefaultJClassLoader, JDK1_5JClassLoader

public interface JClassLoader
extends JVMComponent

This interface represents the class loader component of the Corosol Java Virtual Machine.

Author:
Christophe Deleray

Method Summary
 JClass createArrayClass(java.lang.String name)
          Creates a JClass corresponding to the class array specified by the fully qualified name passed in parameter.
 JClass createClass(JClassFile classfile)
          Creates a JClass object from the classfile data specified by the JClassFile instance.
 JField createField(JClass c, JClassMember fieldInfo)
          Creates a JField object from the data described by the specified classfile item containing the description of a field.
 JMethod createMethod(JClass c, JClassMember methodInfo)
          Creates a JMethod object from the data described by the specified classfile item containing the description of a method of the c class.
 boolean isInterface(JClass fromClazz, JClass clazz)
          Determines if clazz is a superinterface of fromClass.
 boolean isSuperclass(JClass fromClazz, JClass clazz)
          Determines if clazz is a superclass of fromClass.
 JClass loadClass(java.lang.String name)
          Loads the specified class.
 JClass loadPrimitiveClass(java.lang.String descriptor)
          Loads the specified primitive class.
 JClass resolveClass(JClass fromClass, java.lang.String name)
          Executes the dynamic resolution of the class name from the specified class.
 JField resolveField(JClass fromClass, java.lang.String name, java.lang.String className)
          Executes the dynamic resolution of the field name from the specified class.
 JMethod resolveInterfaceMethod(JClass fromClass, java.lang.String name, java.lang.String className, java.lang.String desc)
          Executes the dynamic resolution of the interface method name from the specified class.
 JClassMethod resolveMethod(JClass fromClass, java.lang.String name, java.lang.String className, java.lang.String desc)
          Executes the dynamic resolution of the method name from the specified class.
 
Methods inherited from interface fr.umlv.corosol.component.JVMComponent
configure, getComponentClass, replace
 

Method Detail

loadClass

JClass loadClass(java.lang.String name)
Loads the specified class. If the specified class is not alrady load a new JClass instance is created by the createClass and returned.

Parameters:
name - the name of a class
Returns:
the loaded class
See Also:
createClass(JClassFile)

loadPrimitiveClass

JClass loadPrimitiveClass(java.lang.String descriptor)
Loads the specified primitive class.

Parameters:
descriptor - the descriptor of a primitive type

createClass

JClass createClass(JClassFile classfile)
Creates a JClass object from the classfile data specified by the JClassFile instance.

Parameters:
classfile - a classfile
Returns:
a new instance of the JClass class

createArrayClass

JClass createArrayClass(java.lang.String name)
Creates a JClass corresponding to the class array specified by the fully qualified name passed in parameter.

Parameters:
name - the fully qualified name of an array class
Returns:
a new instance of an array class

createField

JField createField(JClass c,
                   JClassMember fieldInfo)
Creates a JField object from the data described by the specified classfile item containing the description of a field.

Parameters:
c - the class declaring the field which the JField object is created
fieldInfo - a classfile item containing the description of the field object to be created
Returns:
a new instance of the JField describing a field data

createMethod

JMethod createMethod(JClass c,
                     JClassMember methodInfo)
Creates a JMethod object from the data described by the specified classfile item containing the description of a method of the c class.

Parameters:
c - the class declaring the method which the JMethod object is created
methodInfo - a classfile item containing the description of the method object to be created
Returns:
a new instance of the JMethod describing a field data

resolveClass

JClass resolveClass(JClass fromClass,
                    java.lang.String name)
Executes the dynamic resolution of the class name from the specified class.

Parameters:
fromClass - the class from which the resolution is executed
name - the name of the class to resolve
Returns:
the resolved class

resolveField

JField resolveField(JClass fromClass,
                    java.lang.String name,
                    java.lang.String className)
Executes the dynamic resolution of the field name from the specified class.

Parameters:
fromClass - the class from which the resolution is executed
name - the name of the field to resolve
className - the name of the class declaring the field to resolve
Returns:
the resolved field

resolveMethod

JClassMethod resolveMethod(JClass fromClass,
                           java.lang.String name,
                           java.lang.String className,
                           java.lang.String desc)
Executes the dynamic resolution of the method name from the specified class.

Parameters:
fromClass - the class from which the resolution is executed
name - the name of the method to resolve
className - the name of the class declaring the method to resolve
Returns:
the resolved method

resolveInterfaceMethod

JMethod resolveInterfaceMethod(JClass fromClass,
                               java.lang.String name,
                               java.lang.String className,
                               java.lang.String desc)
Executes the dynamic resolution of the interface method name from the specified class.

Parameters:
fromClass - the class from which the resolution is executed
name - the name of the method to resolve
className - the name of the class declaring the method to resolve
Returns:
the resolved method

isInterface

boolean isInterface(JClass fromClazz,
                    JClass clazz)
Determines if clazz is a superinterface of fromClass.

Parameters:
fromClazz - class from which we start the research
clazz - class whose we will dertermine if is is a superinterface of fromClass
Returns:
true if clazz is a superinterface of fromClazz and false otherwise

isSuperclass

boolean isSuperclass(JClass fromClazz,
                     JClass clazz)
Determines if clazz is a superclass of fromClass.

Parameters:
fromClazz - class from which we start the research
clazz - class whose we will dertermine if is is a superclass of fromClass
Returns:
true if clazz is a superclass of fromClazz and false otherwise