Android Guides | Samples

Java.Lang.ClassLoader Class

Loads classes and resources from a repository.

See Also: ClassLoader

Syntax

[Android.Runtime.Register("java/lang/ClassLoader", DoNotGenerateAcw=true)]
public abstract class ClassLoader : Object

Remarks

Loads classes and resources from a repository. One or more class loaders are installed at runtime. These are consulted whenever the runtime system needs a specific class that is not yet available in-memory. Typically, class loaders are grouped into a tree where child class loaders delegate all requests to parent class loaders. Only if the parent class loader cannot satisfy the request, the child class loader itself tries to handle it.

ClassLoader is an abstract class that implements the common infrastructure required by all class loaders. Android provides several concrete implementations of the class, with PathClassLoader being the one typically used. Other applications may implement subclasses of ClassLoader to provide special ways for loading classes.

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.ClassLoader are listed below.

See Also: Object

Protected Constructors

Constructs a new instance of this class with the system class loader as its parent.
Constructs a new instance of this class with the specified class loader as its parent.
A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
ParentClassLoader. Returns this class loader's parent.
[read-only]
static
SystemClassLoaderClassLoader. Returns the system class loader.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

ClearAssertionStatus()
Sets the default assertion status for this class loader to false and removes any package default and class assertion status settings.
GetResource(String) : URL
Returns the URL of the resource with the specified name.
GetResourceAsStream(String) : Stream
Returns a stream for the resource with the specified name.
GetResources(String) : IEnumeration
Returns an enumeration of URLs for the resource with the specified name.
static
GetSystemResource(String) : URL
Finds the URL of the resource with the specified name.
static
GetSystemResourceAsStream(String) : Stream
Returns a stream for the resource with the specified name.
static
GetSystemResources(String) : IEnumeration
Returns an enumeration of URLs for the resource with the specified name.
LoadClass(String) : Class
Loads the class with the specified name.
LoadClassAsync(String) : System.Threading.Tasks.Task<Class>
SetClassAssertionStatus(String, Boolean)
Sets the assertion status of the class with the specified name.
SetDefaultAssertionStatus(Boolean)
Sets the default assertion status for this class loader.
SetPackageAssertionStatus(String, Boolean)
Sets the assertion status of the package with the specified name.

Protected Methods

DefineClass(Byte[], Int32, Int32) : Class
Constructs a new class from an array of bytes containing a class definition in class file format.
DefineClass(String, ByteBuffer, ProtectionDomain) : Class
Defines a new class with the specified name, byte code from the byte buffer and the optional protection domain.
DefineClass(String, Byte[], Int32, Int32) : Class
Constructs a new class from an array of bytes containing a class definition in class file format.
DefineClass(String, Byte[], Int32, Int32, ProtectionDomain) : Class
Constructs a new class from an array of bytes containing a class definition in class file format and assigns the specified protection domain to the new class.
DefinePackage(String, String, String, String, String, String, String, URL) : Package
Defines and returns a new Package using the specified information.
FindClass(String) : Class
Overridden by subclasses, throws a ClassNotFoundException by default.
FindLibrary(String) : String
Returns the absolute path of the native library with the specified name, or null.
FindLoadedClass(String) : Class
Returns the class with the specified name if it has already been loaded by the VM or null if it has not yet been loaded.
FindResource(String) : URL
Finds the URL of the resource with the specified name.
FindResources(String) : IEnumeration
Finds an enumeration of URLs for the resource with the specified name.
FindSystemClass(String) : Class
Finds the class with the specified name, loading it using the system class loader if necessary.
GetClassLoadingLock(String) : Object
GetPackage(String) : Package
Returns the package with the specified name.
GetPackages() : Package[]
Returns all the packages known to this class loader.
LoadClass(String, Boolean) : Class
Loads the class with the specified name, optionally linking it after loading.
LoadClassAsync(String, Boolean) : System.Threading.Tasks.Task<Class>
static
RegisterAsParallelCapable() : Boolean
ResolveClass(Class)
SetSigners(Class, Object[])