Interface JamClassLoader
-
- All Known Implementing Classes:
JamClassLoaderImpl
public interface JamClassLoader
Object which can load representations of a java.lang.Class. Analagous to a java.lang.ClassLoader.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JPackage
getPackage(java.lang.String qualifiedPackageName)
Returns a representation of a package having the given name.JClass
loadClass(java.lang.String fieldDescriptor)
Returns a representation of the named class.
-
-
-
Method Detail
-
loadClass
JClass loadClass(java.lang.String fieldDescriptor)
Returns a representation of the named class. If the class is not under the same root as this JElement root, a representation of it will be synthesized via reflection (see note in class comments). The 'named' parameter must be a fully-qualified class name in the classfile 'Field Descriptor' format, a simple primitive name (e.g. 'long' or 'int'), or 'void'.
A note regarding fully-qualified class names: if you're looking up a non-array type by name, you can just pass the regular, fully-qualified name. If you're looking up an array type, you need to use the 'Field Descriptor' format as described in secion 4.3.2 of the VM spec. This is the same name format that is returned by JClass.getFieldDescriptor.
Inner classes cannot be loaded with this method. To load an inner class, you must load the outer class first and then call getClasses().
Note that this method always returns some JClass - it never returns null or throws ClassNotFoundException. If neither a sourcefile not a classfile could be located for the named class, a stubbed-out JClass will be returned with the isUnresolved() flag set to true. This JClass will have a name (as determined by the given descriptor), but no other information about it will be available.
- Throws:
java.lang.IllegalArgumentException
- if the parameter is null or not a valid class name.
-
getPackage
JPackage getPackage(java.lang.String qualifiedPackageName)
Returns a representation of a package having the given name.- Throws:
java.lang.IllegalArgumentException
- if the parameter is null or not a valid package name.
-
-