Class System.ClassLoader
A class loader is responsible for loading class. Its behaviour is quite the same as ClassLoaders in Java, but since this is JavaScript, you need to be very careful of what you are doing.
Basically ZWT defines a system classLoader that should be used to load every classes. Again, this is not Java, there is no use to create a complex classLoader hierarchy.
Classes are asynchronously loaded, it means a class may not be loaded when the loadClass method returns, you should use the System.ClassLoader.ClassLoadListener to monitor classes load.
Defined in: zwt.js.
Constructor Attributes | Constructor Name and Description |
---|---|
System.ClassLoader(array_urls)
Construct a System.ClassLoader object.
|
Method Attributes | Method Name and Description |
---|---|
addUrl(URL_url)
Append the specified URL to the list of URLs to search for classes.
|
|
defineClass(string_name, string_data)
Define the specified class data.
|
|
Return the class load event manager associated to the ClassLoader.
|
|
<static> |
System.ClassLoader.getSystemClassLoader()
Return the system class loader.
|
isClassLoaded(string_name)
Test if the specified class is already loaded.
|
|
loadClass(string_name)
Load the specified class.
|
Class Detail
System.ClassLoader(array_urls)
Construct a System.ClassLoader object.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {String[]} array_urls
- The URLs used to search for classes.
Method Detail
addUrl(URL_url)
Append the specified URL to the list of URLs to search for classes.
- Parameters:
- {URL} URL_url
- The URL to add.
defineClass(string_name, string_data)
Define the specified class data.
- Parameters:
- {String} string_name
- The class name.
- {String} string_data
- The string data.
{System.ClassLoader.ClassLoadEventManager}
getClassLoadEventManager()
Return the class load event manager associated to the ClassLoader.
- Returns:
- A Class load event manager
<static>
{System.ClassLoader}
System.ClassLoader.getSystemClassLoader()
Return the system class loader.
- Returns:
- The system class loader.
{Boolean}
isClassLoaded(string_name)
Test if the specified class is already loaded.
- Parameters:
- {String} string_name
- The class to test.
- Returns:
- true if the string_name is loaded.
loadClass(string_name)
Load the specified class. The class is loaded asynchronously so this method may return before the class is actually loaded.
- Parameters:
- {String} string_name
- The class name.