aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/VMClassLoader.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-07-23 20:01:29 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-07-23 20:01:29 +0000
commite109d16f8c56fa61f9b4c15a2426ad07ac88cbd6 (patch)
treeb78c8d040343fe28feb343232f40dc3553894b9e /libjava/java/lang/VMClassLoader.java
parent57de7530c4c6d768559b39634fadf5bf27475359 (diff)
downloadgcc-e109d16f8c56fa61f9b4c15a2426ad07ac88cbd6.zip
gcc-e109d16f8c56fa61f9b4c15a2426ad07ac88cbd6.tar.gz
gcc-e109d16f8c56fa61f9b4c15a2426ad07ac88cbd6.tar.bz2
javaprims.h: Rebuilt class list.
* gcj/javaprims.h: Rebuilt class list. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added VMClassLoader. * java/lang/VMClassLoader.java: New file. * java/lang/Boolean.java: Merged with Classpath. * java/lang/Byte.java: Merged with Classpath. * java/lang/Integer.java: Merged with Classpath. * java/lang/Long.java: Merged with Classpath. * java/lang/Number.java: Merged with Classpath. * java/lang/Short.java: Merged with Classpath. From-SVN: r44274
Diffstat (limited to 'libjava/java/lang/VMClassLoader.java')
-rw-r--r--libjava/java/lang/VMClassLoader.java85
1 files changed, 85 insertions, 0 deletions
diff --git a/libjava/java/lang/VMClassLoader.java b/libjava/java/lang/VMClassLoader.java
new file mode 100644
index 0000000..de0db88
--- /dev/null
+++ b/libjava/java/lang/VMClassLoader.java
@@ -0,0 +1,85 @@
+/*
+ * java.lang.ClassLoader: part of the Java Class Libraries project.
+ * Copyright (C) 1998, 2001 Free Software Foundation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+package java.lang;
+
+/**
+ * java.lang.VMClassLoader is a package-private helper for VMs to implement
+ * on behalf of java.lang.ClassLoader.
+ *
+ * @author John Keiser
+ * @version 1.1.0, Sep 22 1998
+ * @since CP1.1
+ */
+
+class VMClassLoader {
+
+ /**
+ * Helper to define a class using a string of bytes.
+ *
+ * @param name the name to give the class. null if unknown.
+ * @param data the data representing the classfile, in classfile format.
+ * @param offset the offset into the data where the classfile starts.
+ * @param len the length of the classfile data in the array.
+ * @return the class that was defined.
+ * @exception ClassFormatError if the byte array is not in proper classfile format.
+ */
+ // Not yet needed for libgcj.
+// final static native Class defineClass(ClassLoader cl, String name,
+// byte[] data, int offset, int len) throws ClassFormatError;
+
+ /**
+ * Helper to resolve all references to other classes from this class.
+ * @param c the class to resolve.
+ */
+ // Not yet needed for libgcj.
+ // final static native void resolveClass(Class c);
+
+ /**
+ * Helper for java.lang.Integer, Byte, etc. to get the TYPE class
+ * at initialization time. If there are multiple classloaders, this
+ * method may be called once per ClassLoader per type.
+ *
+ * @param type name of the primitive type; i.e. "int", "byte", etc.
+ * @return a "bogus" class representing the primitive type.
+ */
+ static final Class getPrimitiveClass(String type)
+ {
+ if ("int".equals (type))
+ return int.class;
+ else if ("long".equals (type))
+ return int.class;
+ else if ("boolean".equals (type))
+ return int.class;
+ else if ("short".equals (type))
+ return int.class;
+ else if ("char".equals (type))
+ return int.class;
+ else if ("byte".equals (type))
+ return int.class;
+ else if ("float".equals (type))
+ return int.class;
+ else if ("double".equals (type))
+ return int.class;
+ else if ("void".equals (type))
+ return int.class;
+ return null;
+ }
+}