Class JamClassLoaderImpl

    • 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 interface JamClassLoader
      • 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 interface JamClassLoader
      • 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)