| Method from java.lang.VMClassLoader Detail: |
static final Map classAssertionStatus() {
return new HashMap();
}
The system default for class assertion status. This is used for all
ClassLoader's classAssertionStatus defaults. It must be a map of
class names to Boolean.TRUE or Boolean.FALSE
XXX - Not implemented yet; this requires native help. |
static final boolean defaultAssertionStatus() {
return true;
}
The system default for assertion status. This is used for all system
classes (those with a null ClassLoader), as well as the initial value for
every ClassLoader's default assertion status.
XXX - Not implemented yet; this requires native help. |
static final native Class defineClass(ClassLoader cl,
String name,
byte[] data,
int offset,
int len,
ProtectionDomain pd) throws ClassFormatError
Helper to define a class using a string of bytes. This assumes that
the security checks have already been performed, if necessary.
Implementations of this method are advised to consider the
situation where user code modifies the byte array after it has
been passed to defineClass. This can be handled by making a
private copy of the array, or arranging to only read any given
byte a single time. |
static final Class defineClassWithTransformers(ClassLoader loader,
String name,
byte[] data,
int offset,
int len,
ProtectionDomain pd) {
if (instrumenter != null)
{
byte[] modifiedData = new byte[len];
System.arraycopy(data, offset, modifiedData, 0, len);
modifiedData =
((InstrumentationImpl)instrumenter).callTransformers(loader, name,
null, pd, modifiedData);
return defineClass(loader, name, modifiedData, 0, modifiedData.length,
pd);
}
else
{
return defineClass(loader, name, data, offset, len, pd);
}
}
Call the transformers of the possible Instrumentation object. This
implementation assumes the instrumenter is a
InstrumentationImpl object. VM implementors would
have to redefine this method if they provide their own implementation
of the Instrumentation interface. |
static native Class findLoadedClass(ClassLoader cl,
String name)
Find the class if this class loader previously defined this class
or if this class loader has been recorded as the initiating class loader
for this class. |
static Package getPackage(String name) {
return (Package)definedPackages.get(name);
}
Helper to get a package from the bootstrap class loader. |
static Package[] getPackages() {
Package[] packages = new Package[definedPackages.size()];
definedPackages.values().toArray(packages);
return packages;
}
Helper to get all packages from the bootstrap class loader. |
static final native Class getPrimitiveClass(char type)
Helper for java.lang.Integer, Byte, etc to get the TYPE class
at initialization time. The type code is one of the chars that
represents the primitive type as in JNI.
- 'Z' - boolean
- 'B' - byte
- 'C' - char
- 'D' - double
- 'F' - float
- 'I' - int
- 'J' - long
- 'S' - short
- 'V' - void
|
static URL getResource(String name) {
String[] packages = getBootPackages();
if( packages != null)
{
String specName =
SystemProperties.getProperty("java.specification.name");
String vendor =
SystemProperties.getProperty("java.specification.vendor");
String version =
SystemProperties.getProperty("java.specification.version");
Package p;
for(int i = 0; i < packages.length; i++)
{
p = new Package(packages[i],
specName,
vendor,
version,
"GNU Classpath",
"GNU",
Configuration.CLASSPATH_VERSION,
null,
null);
definedPackages.put(packages[i], p);
}
}
Enumeration e = getResources(name);
if (e.hasMoreElements())
return (URL)e.nextElement();
return null;
}
Helper to load a resource from the bootstrap class loader. |
static Enumeration getResources(String name) {
StringTokenizer st = new StringTokenizer(
SystemProperties.getProperty("java.boot.class.path", "."),
File.pathSeparator);
Vector v = new Vector();
while (st.hasMoreTokens())
{
File file = new File(st.nextToken());
if (file.isDirectory())
{
try
{
File f = new File(file, name);
if (!f.exists()) continue;
v.add(new URL("file://" + f.getAbsolutePath()));
}
catch (MalformedURLException e)
{
throw new Error(e);
}
}
else if (file.isFile())
{
ZipFile zip;
synchronized(bootjars)
{
zip = (ZipFile) bootjars.get(file.getName());
}
if(zip == null)
{
try
{
zip = new ZipFile(file);
synchronized(bootjars)
{
bootjars.put(file.getName(), zip);
}
}
catch (IOException e)
{
continue;
}
}
String zname = name.startsWith("/") ? name.substring(1) : name;
if (zip.getEntry(zname) == null)
continue;
try
{
v.add(new URL("jar:file://"
+ file.getAbsolutePath() + "!/" + zname));
}
catch (MalformedURLException e)
{
throw new Error(e);
}
}
}
return v.elements();
}
Helper to get a list of resources from the bootstrap class loader. |
static ClassLoader getSystemClassLoader() {
return ClassLoader.defaultGetSystemClassLoader();
}
|
static final native Class loadClass(String name,
boolean resolve) throws ClassNotFoundException
Helper to load a class from the bootstrap class loader. |
static final Map packageAssertionStatus() {
return new HashMap();
}
The system default for package assertion status. This is used for all
ClassLoader's packageAssertionStatus defaults. It must be a map of
package names to Boolean.TRUE or Boolean.FALSE, with the unnamed package
represented as a null key.
XXX - Not implemented yet; this requires native help. |
static final native void resolveClass(Class c)
Helper to resolve all references to other classes from this class. |