Lines Matching refs:name

66  * href="#name">binary name</a> of a class, a class loader should attempt to
68 * typical strategy is to transform the name into a file name and then read a
69 * "class file" of that name from a file system.
149 * public Class findClass(String name) {
150 * byte[] b = loadClassData(name);
151 * return defineClass(name, b, 0, b.length);
154 * private byte[] loadClassData(String name) {
161 * <h4> <a name="name">Binary names</a> </h4>
163 * <p> Any class name provided as a {@link String} parameter to methods in
164 * <tt>ClassLoader</tt> must be a binary name as defined by
236 // Maps class name to the corresponding lock object when the current
266 // The packages defined in this class loader. Each package name is mapped
341 * Loads the class with the specified <a href="#name">binary name</a>.
345 * to invoking {@link #loadClass(String, boolean) <tt>loadClass(name,
348 * @param name
349 * The <a href="#name">binary name</a> of the class
356 public Class<?> loadClass(String name) throws ClassNotFoundException {
357 return loadClass(name, false);
361 * Loads the class with the specified <a href="#name">binary name</a>. The
390 * @param name
391 * The <a href="#name">binary name</a> of the class
401 protected Class<?> loadClass(String name, boolean resolve)
404 synchronized (getClassLoadingLock(name)) {
406 Class c = findLoadedClass(name);
411 c = parent.loadClass(name, false);
413 c = findBootstrapClassOrNull(name);
424 c = findClass(name);
444 * with the specified class name. Otherwise, the method returns this
448 * The name of the to-be-loaded class
472 private Class loadClassInternal(String name)
479 return loadClass(name);
482 return loadClass(name);
490 final String name = cls.getName();
491 final int i = name.lastIndexOf('.');
495 sm.checkPackageAccess(name.substring(0, i));
505 * Finds the class with the specified <a href="#name">binary name</a>.
512 * @param name
513 * The <a href="#name">binary name</a> of the class
522 protected Class<?> findClass(String name) throws ClassNotFoundException {
523 throw new ClassNotFoundException(name);
530 * href="#name">binary name</a> as its first argument, and is more secure.
558 * to define a class in a package with a fully-qualified name
593 * @param name
594 * The expected <a href="#name">binary name</a> of the class, or
623 * <tt>name</tt> begins with "<tt>java.</tt>".
632 protected final Class<?> defineClass(String name, byte[] b, int off, int len)
635 return defineClass(name, b, off, len, null);
643 private ProtectionDomain preDefineClass(String name,
646 if (!checkName(name))
647 throw new NoClassDefFoundError("IllegalName: " + name);
649 if ((name != null) && name.startsWith("java.")) {
651 ("Prohibited package name: " +
652 name.substring(0, name.lastIndexOf('.')));
658 if (name != null) checkCerts(name, pd.getCodeSource());
673 private Class defineTransformedClass(String name, byte[] b, int off, int len,
690 c = defineClass1(name, tb, 0, tb.length,
731 * <tt>name</tt> is <tt>null</tt>, this check is not performed.
732 * You should always pass in the <a href="#name">binary name</a> of the
736 * <p> The specified <tt>name</tt> cannot begin with "<tt>java.</tt>", since
738 * bootstrap class loader. If <tt>name</tt> is not <tt>null</tt>, it
739 * must be equal to the <a href="#name">binary name</a> of the class
743 * @param name
744 * The expected <a href="#name">binary name</a> of the class, or
769 * If <tt>name</tt> is not equal to the <a href="#name">binary
770 * name</a> of the class specified by <tt>b</tt>
779 * certificates than this class, or if <tt>name</tt> begins with
782 protected final Class<?> defineClass(String name, byte[] b, int off, int len,
786 protectionDomain = preDefineClass(name, protectionDomain);
792 c = defineClass1(name, b, off, len, protectionDomain, source);
794 c = defineTransformedClass(name, b, off, len, protectionDomain, cfe,
816 * <i>cl</i><tt>.defineClass(</tt><i>name</i><tt>,</tt>
827 * </tt><i>cl</i><tt>.defineClass}(</tt><i>name</i><tt>, temp, 0,
831 * @param name
832 * The expected <a href="#name">binary name</a>. of the class, or
851 * If <tt>name</tt> is not equal to the <a href="#name">binary
852 * name</a> of the class specified by <tt>b</tt>
857 * certificates than this class, or if <tt>name</tt> begins with
864 protected final Class<?> defineClass(String name, java.nio.ByteBuffer b,
873 return defineClass(name, b.array(),
880 return defineClass(name, tb, 0, len, protectionDomain);
884 protectionDomain = preDefineClass(name, protectionDomain);
890 c = defineClass2(name, b, b.position(), len, protectionDomain,
895 c = defineTransformedClass(name, tb, 0, len, protectionDomain, cfe,
903 private native Class defineClass0(String name, byte[] b, int off, int len,
906 private native Class defineClass1(String name, byte[] b, int off, int len,
909 private native Class defineClass2(String name, java.nio.ByteBuffer b,
913 // true if the name is null or has the potential to be a valid binary name
914 private boolean checkName(String name) {
915 if ((name == null) || (name.length() == 0))
917 if ((name.indexOf('/') != -1)
918 || (!VM.allowArraySyntax() && (name.charAt(0) == '[')))
923 private void checkCerts(String name, CodeSource cs) {
924 int i = name.lastIndexOf('.');
925 String pname = (i == -1) ? "" : name.substring(0, i);
944 throw new SecurityException("class \""+ name +
1017 * Finds a class with the specified <a href="#name">binary name</a>,
1027 * @param name
1028 * The <a href="#name">binary name</a> of the class
1030 * @return The <tt>Class</tt> object for the specified <tt>name</tt>
1038 protected final Class<?> findSystemClass(String name)
1043 if (!checkName(name))
1044 throw new ClassNotFoundException(name);
1045 Class cls = findBootstrapClass(name);
1047 throw new ClassNotFoundException(name);
1051 return system.loadClass(name);
1058 private Class findBootstrapClassOrNull(String name)
1060 if (!checkName(name)) return null;
1062 return findBootstrapClass(name);
1066 private native Class findBootstrapClass(String name);
1069 * Returns the class with the given <a href="#name">binary name</a> if this
1071 * loader of a class with that <a href="#name">binary name</a>. Otherwise
1074 * @param name
1075 * The <a href="#name">binary name</a> of the class
1082 protected final Class<?> findLoadedClass(String name) {
1083 if (!checkName(name))
1085 return findLoadedClass0(name);
1088 private native final Class findLoadedClass0(String name);
1110 * Finds the resource with the given name. A resource is some data
1114 * <p> The name of a resource is a '<tt>/</tt>'-separated path name that
1122 * @param name
1123 * The resource name
1131 public URL getResource(String name) {
1134 url = parent.getResource(name);
1136 url = getBootstrapResource(name);
1139 url = findResource(name);
1145 * Finds all the resources with the given name. A resource is some data
1149 * <p>The name of a resource is a <tt>/</tt>-separated path name that
1155 * @param name
1156 * The resource name
1170 public Enumeration<URL> getResources(String name) throws IOException {
1173 tmp[0] = parent.getResources(name);
1175 tmp[0] = getBootstrapResources(name);
1177 tmp[1] = findResources(name);
1183 * Finds the resource with the given name. Class loader implementations
1186 * @param name
1187 * The resource name
1194 protected URL findResource(String name) {
1200 * representing all the resources with the given name. Class loader
1204 * @param name
1205 * The resource name
1215 protected Enumeration<URL> findResources(String name) throws IOException {
1242 * Find a resource of the specified name from the search path used to load
1246 * @param name
1247 * The resource name
1254 public static URL getSystemResource(String name) {
1257 return getBootstrapResource(name);
1259 return system.getResource(name);
1263 * Finds all resources of the specified name from the search path used to
1271 * @param name
1272 * The resource name
1282 public static Enumeration<URL> getSystemResources(String name)
1287 return getBootstrapResources(name);
1289 return system.getResources(name);
1295 private static URL getBootstrapResource(String name) {
1297 Resource res = ucp.getResource(name);
1304 private static Enumeration<URL> getBootstrapResources(String name)
1308 getBootstrapClassPath().getResources(name);
1331 * @param name
1332 * The resource name
1339 public InputStream getResourceAsStream(String name) {
1340 URL url = getResource(name);
1349 * Open for reading, a resource of the specified name from the search path
1353 * @param name
1354 * The resource name
1361 public static InputStream getSystemResourceAsStream(String name) {
1362 URL url = getSystemResource(name);
1423 * taken to be the name of a class that will be returned as the system
1570 * Defines a package by name in this <tt>ClassLoader</tt>. This allows
1576 * @param name
1577 * The package name
1605 * If package name duplicates an existing package either in this
1610 protected Package definePackage(String name, String specTitle,
1617 Package pkg = getPackage(name);
1619 throw new IllegalArgumentException(name);
1621 pkg = new Package(name, specTitle, specVersion, specVendor,
1624 packages.put(name, pkg);
1633 * @param name
1634 * The package name
1636 * @return The <tt>Package</tt> corresponding to the given name, or
1641 protected Package getPackage(String name) {
1644 pkg = packages.get(name);
1648 pkg = parent.getPackage(name);
1650 pkg = Package.getSystemPackage(name);
1654 Package pkg2 = packages.get(name);
1656 packages.put(name, pkg);
1701 * Returns the absolute path name of a native library. The VM invokes this
1708 * The library name
1744 // the canonicalized name of the native library.
1745 String name;
1747 native void load(String name);
1748 native long find(String name);
1751 public NativeLibrary(Class fromClass, String name) {
1752 this.name = name;
1759 /* remove the native library name */
1762 if (name.equals(loadedLibraryNames.elementAt(i))) {
1834 static void loadLibrary(Class fromClass, String name,
1843 if (loadLibrary0(fromClass, new File(name))) {
1846 throw new UnsatisfiedLinkError("Can't load library: " + name);
1849 String libfilename = loader.findLibrary(name);
1863 File libfile = new File(sys_paths[i], System.mapLibraryName(name));
1871 System.mapLibraryName(name));
1878 throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
1902 String name;
1904 name = file.getCanonicalPath();
1916 if (name.equals(lib.name)) {
1922 if (loadedLibraryNames.contains(name)) {
1925 name +
1943 if (name.equals(lib.name)) {
1949 name +
1954 NativeLibrary lib = new NativeLibrary(fromClass, name);
1957 lib.load(name);
1962 loadedLibraryNames.addElement(name);
1972 static long findNative(ClassLoader loader, String name) {
1979 long entry = lib.find(name);
2041 * <p> A subpackage of a package named p is any package whose name begins
2058 * The name of the package whose package default assertion status
2094 * The fully qualified class name of the top-level class whose
2146 * The fully qualified class name of the class whose desired