Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/jdk.jdi/share/classes/com/sun/jdi/ClassLoaderReference.java
41159 views
1
/*
2
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package com.sun.jdi;
27
28
import java.util.List;
29
30
/**
31
* A class loader object from the target VM.
32
* A ClassLoaderReference is an {@link ObjectReference} with additional
33
* access to classloader-specific information from the target VM. Instances
34
* ClassLoaderReference are obtained through calls to
35
* {@link ReferenceType#classLoader}
36
*
37
* @see ObjectReference
38
*
39
* @author Gordon Hirsch
40
* @since 1.3
41
*/
42
public interface ClassLoaderReference extends ObjectReference {
43
44
/**
45
* Returns a list of all classes defined by this class loader.
46
* No ordering of this list guaranteed.
47
* The returned list will include all reference types, including
48
* {@linkplain Class#isHidden hidden classes or interfaces}, loaded
49
* at least to the point of preparation, and types (like array)
50
* for which preparation is not defined.
51
*
52
* @return a {@code List} of {@link ReferenceType} objects mirroring types
53
* defined by this class loader. The list has length 0 if no types
54
* have been defined by this classloader.
55
*/
56
List<ReferenceType> definedClasses();
57
58
/**
59
* Returns a list of all classes which this class loader
60
* can find by name via {@link ClassLoader#loadClass(String, boolean)
61
* ClassLoader::loadClass}, {@link Class#forName(String) Class::forName}
62
* and bytecode linkage in the target VM. That is, all classes for
63
* which this class loader has been recorded as an initiating loader.
64
* <p>
65
* Each class in the returned list was created by this class loader
66
* either by defining it directly or by delegation to another class loader
67
* (see JVMS {@jvms 5.3}).
68
* <p>
69
* The returned list does not include {@linkplain Class#isHidden()
70
* hidden classes or interfaces} or array classes whose
71
* {@linkplain ArrayType#componentType() element type} is a
72
* {@linkplain Class#isHidden() hidden class or interface}.
73
* as they cannot be discovered by any class loader
74
* <p>
75
* The visible class list has useful properties with respect to
76
* the type namespace. A particular type name will occur at most
77
* once in the list. Each field or variable declared with that
78
* type name in a class defined by
79
* this class loader must be resolved to that single type.
80
* <p>
81
* No ordering of the returned list is guaranteed.
82
* <p>
83
* Note that unlike {@link #definedClasses()}
84
* and {@link VirtualMachine#allClasses()},
85
* some of the returned reference types may not be prepared.
86
* Attempts to perform some operations on unprepared reference types
87
* (e.g. {@link ReferenceType#fields() fields()}) will throw
88
* a {@link ClassNotPreparedException}.
89
* Use {@link ReferenceType#isPrepared()} to determine if
90
* a reference type is prepared.
91
*
92
* @return a {@code List} of {@link ReferenceType} objects mirroring
93
* classes which this class loader can find by name. The list
94
* has length 0 if no classes are visible to this classloader.
95
*
96
* @see <a href="{@docRoot}/../specs/jvmti/jvmti.html#GetClassLoaderClasses">
97
* JVM TI GetClassLoaderClasses</a>
98
*/
99
List<ReferenceType> visibleClasses();
100
}
101
102