java.lang.Object | ||
↳ | java.lang.ClassLoader | |
↳ | dalvik.system.BaseDexClassLoader |
Known Direct Subclasses |
Base class for common functionality between various dex-based
ClassLoader
implementations.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the absolute path of the native library with the specified name,
or
null . | |||||||||||
Returns a string containing a concise, human-readable description of this
object.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overridden by subclasses, throws a
ClassNotFoundException by
default. | |||||||||||
Finds the URL of the resource with the specified name.
| |||||||||||
Finds an enumeration of URLs for the resource with the specified name.
| |||||||||||
Returns package information for the given package.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.ClassLoader
| |||||||||||
From class
java.lang.Object
|
Constructs an instance.
dexPath | the list of jar/apk files containing classes and
resources, delimited by File.pathSeparator , which
defaults to ":" on Android |
---|---|
optimizedDirectory | directory where optimized dex files
should be written; may be null |
libraryPath | the list of directories containing native
libraries, delimited by File.pathSeparator ; may be
null |
parent | the parent class loader |
Returns the absolute path of the native library with the specified name,
or null
. If this method returns null
then the virtual
machine searches the directories specified by the system property
"java.library.path".
This implementation always returns null
.
name | the name of the library to find. |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Overridden by subclasses, throws a ClassNotFoundException
by
default. This method is called by loadClass
after the parent
ClassLoader
has failed to find a loaded class of the same name.
name | the name of the class to look for. |
---|
Class
object that is found.ClassNotFoundException |
---|
Finds the URL of the resource with the specified name. This
implementation just returns null
; it should be overridden in
subclasses.
name | the name of the resource to find. |
---|
URL
object for the requested resource.
Finds an enumeration of URLs for the resource with the specified name.
This implementation just returns an empty Enumeration
; it should
be overridden in subclasses.
name | the name of the resource to find. |
---|
URL
objects for the requested resource.Returns package information for the given package.
Unfortunately, instances of this class don't really have this
information, and as a non-secure ClassLoader
, it isn't
even required to, according to the spec. Yet, we want to
provide it, in order to make all those hopeful callers of
myClass.getPackage().getName()
happy. Thus we construct
a Package
object the first time it is being requested
and fill most of the fields with dummy values. The Package
object is then put into the ClassLoader
's
package cache, so we see the same one next time. We don't
create Package
objects for null
arguments or
for the default package.
There is a limited chance that we end up with multiple
Package
objects representing the same package: It can
happen when when a package is scattered across different JAR
files which were loaded by different ClassLoader
instances. This is rather unlikely, and given that this whole
thing is more or less a workaround, probably not worth the
effort to address.
name | the name of the class |
---|
null
if there is no package information available for it