Class JamClassLoaderImpl
- java.lang.Object
-
- org.apache.xmlbeans.impl.jam.internal.JamClassLoaderImpl
-
- All Implemented Interfaces:
JamClassLoader
public class JamClassLoaderImpl extends java.lang.Object implements JamClassLoader
-
-
Constructor Summary
Constructors Constructor Description JamClassLoaderImpl(ElementContext context, JamClassBuilder builder, MVisitor initializerOrNull)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToCache(JClass c)
JPackage
getPackage(java.lang.String named)
Returns a representation of a package having the given name.java.util.Collection
getResolvedClasses()
Returns an unmodifiable collection containing the JClasses which have been resolved by this JamClassLoader.void
initialize(ClassImpl out)
JClass
loadClass(java.lang.String fd)
Returns a representation of the named class.
-
-
-
Constructor Detail
-
JamClassLoaderImpl
public JamClassLoaderImpl(ElementContext context, JamClassBuilder builder, MVisitor initializerOrNull)
-
-
Method Detail
-
loadClass
public final JClass loadClass(java.lang.String fd)
Description copied from interface:JamClassLoader
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.
- Specified by:
loadClass
in interfaceJamClassLoader
-
getPackage
public JPackage getPackage(java.lang.String named)
Description copied from interface:JamClassLoader
Returns a representation of a package having the given name.- Specified by:
getPackage
in interfaceJamClassLoader
-
initialize
public void initialize(ClassImpl out)
-
getResolvedClasses
public java.util.Collection getResolvedClasses()
Returns an unmodifiable collection containing the JClasses which have been resolved by this JamClassLoader.
-
addToCache
public void addToCache(JClass c)
-
-