Classes in this package, along with java.lang.Class
accommodate applications such as debuggers, interpreters, object
inspectors, class browsers, and services such as Object
Serialization and JavaBeans that need access to either the public
members of a target object (based on its runtime class) or the
members declared by a given class.
AccessibleObject
allows suppression of access checks if
the necessary ReflectPermission
is available.
Array
provides static methods to dynamically create and
access arrays.
Class
, Package
, and Module
,
fundamentally present a JVM model of the entities in question
rather than a Java programming language model. A Java compiler,
such as javac
, translates Java source code into executable
output that can be run on a JVM, primarily class
files. Compilers for source languages other than Java can and do
target the JVM as well.
The translation process, including from Java language sources,
to executable output for the JVM is not a one-to-one
mapping. Structures present in the source language may have no
representation in the output and structures not present in
the source language may be present in the output. The latter are
called synthetic structures. Synthetic structures can
include methods, fields, parameters, classes and
interfaces. One particular kind of synthetic method is a
bridge method. It is possible a
synthetic structure may not be marked as such. In particular, not
all class
file versions support marking a parameter as
synthetic. A source language compiler generally has multiple ways
to translate a source program into a class
file
representation. The translation may also depend on the version of
the class
file format being targeted as different class
file versions have different capabilities and features. In
some cases the modifiers present in the class
file
representation may differ from the modifiers on the originating
element in the source language, including final
on a parameter and
protected
, private
, and static
on
classes and interfaces.
Besides differences in structural representation between the
source language and the JVM representation, core reflection also
exposes runtime specific information. For example, the class loaders and protection domains of a
Class
are runtime concepts without a direct analogue in
source code.
Modifier and Type | Interface and Description |
---|---|
public interface | AnnotatedArrayType
|
public interface | AnnotatedElement
Represents an annotated construct of the program currently running in this VM. |
public interface | AnnotatedParameterizedType
|
public interface | AnnotatedType
|
public interface | AnnotatedTypeVariable
|
public interface | AnnotatedWildcardType
|
public interface | GenericArrayType
|
public interface | GenericDeclaration
A common interface for all entities that declare type variables. |
public interface | InvocationHandler
|
public interface | Member
Member is an interface that reflects identifying information about a single member (a field or a method) or a constructor. |
public interface | ParameterizedType
ParameterizedType represents a parameterized type such as
|
public interface | Type
Type is the common superinterface for all types in the Java programming language. |
public interface | TypeVariable<
the type of generic declaration that declared the
underlying type variable. D extends GenericDeclaration>TypeVariable is the common superinterface for type variables of kinds. |
public interface | WildcardType
WildcardType represents a wildcard type expression, such as
|
Modifier and Type | Class and Description |
---|---|
public class | AccessibleObject
The |
public class | Array
The |
public class | Constructor<
the class in which the constructor is declared T>
|
public abstract class | Executable
A shared superclass for the common functionality of |
public class | Field
A |
public class | GenericSignatureFormatError
Thrown when a syntactically malformed signature attribute is encountered by a reflective method that needs to interpret the generic signature information for a class or interface, method or constructor. |
public class | InaccessibleObjectException
Thrown when Java language access checks cannot be suppressed. |
public class | InvocationTargetException
InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor. |
public class | MalformedParameterizedTypeException
Thrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it. |
public class | MalformedParametersException
Thrown when |
public class | Method
A |
public class | Modifier
The Modifier class provides |
public class | Parameter
Information about method parameters. |
public class | Proxy
|
pack-priv class | ProxyGenerator
ProxyGenerator contains the code to generate a dynamic proxy class for the java.lang.reflect.Proxy API. |
public class | RecordComponent
A |
pack-priv class | ReflectAccess
Package-private class implementing the jdk.internal.access.JavaLangReflectAccess interface, allowing the java.lang package to instantiate objects in this package. |
public class | ReflectPermission
The Permission class for reflective operations. |
public class | UndeclaredThrowableException
Thrown by a method invocation on a proxy instance if its invocation
handler's |
Modifier and Type | Enum and Description |
---|---|
public enum | AccessFlag
Represents a JVM access or module-related flag on a runtime member, such as a class, field, or method. |
public enum | ClassFileFormatVersion
Class file format versions of the Java virtual machine. |