diff options
author | Guilhem Lavaux <guilhem@kaffe.org> | 2003-12-16 11:35:40 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-12-16 11:35:40 +0000 |
commit | 5ecc3a7676ce8e4e2da59d7fb8d826f0b3b832c7 (patch) | |
tree | 43e7e9a71bb64de9a6b042112c914242dd70c5ac /libjava/gnu/java/lang/reflect | |
parent | 9a1349b9209349989a0b776fe0683c21b197776e (diff) | |
download | gcc-5ecc3a7676ce8e4e2da59d7fb8d826f0b3b832c7.zip gcc-5ecc3a7676ce8e4e2da59d7fb8d826f0b3b832c7.tar.gz gcc-5ecc3a7676ce8e4e2da59d7fb8d826f0b3b832c7.tar.bz2 |
TypeSignature.java (getClassForEncoding): Splitted the method so we can specify an explicit boot loader.
2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
Helmer Kraemer <hkraemer@freenet.de>
* gnu/java/lang/reflect/TypeSignature.java (getClassForEncoding):
Splitted the method so we can specify an explicit boot loader.
Co-Authored-By: Helmer Kraemer <hkraemer@freenet.de>
From-SVN: r74687
Diffstat (limited to 'libjava/gnu/java/lang/reflect')
-rw-r--r-- | libjava/gnu/java/lang/reflect/TypeSignature.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libjava/gnu/java/lang/reflect/TypeSignature.java b/libjava/gnu/java/lang/reflect/TypeSignature.java index e9c8861..1cf55a6 100644 --- a/libjava/gnu/java/lang/reflect/TypeSignature.java +++ b/libjava/gnu/java/lang/reflect/TypeSignature.java @@ -1,5 +1,5 @@ /* TypeSignature.java -- Class used to compute type signatures - Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -150,6 +150,29 @@ public class TypeSignature public static Class getClassForEncoding(String type_code, boolean descriptor) throws ClassNotFoundException { + return getClassForEncoding(type_code, descriptor, null); + } + + /** + * This function is the inverse of <code>getEncodingOfClass</code>. This + * accepts both object and descriptor formats, but must know which style + * of string is being passed in (usually, descriptor should be true).In + * descriptor format, "I" is treated as int.class, in object format, it + * is treated as a class named I in the unnamed package. It also + * accepts a <code>ClassLoader</code>, which is used to load the class. + * + * @param type_code the class name to decode + * @param descriptor if the string is in descriptor format + * @param loader the class loader used to load the class + * @return the corresponding Class object + * @throws ClassNotFoundException if the class cannot be located + * @see #getEncodingOfClass(Class, boolean) + * @see #getClassForEncoding(String, boolean) + */ + public static Class getClassForEncoding(String type_code, boolean descriptor, + ClassLoader loader) + throws ClassNotFoundException + { if (descriptor) { switch (type_code.charAt(0)) |