Package java.lang.reflect
Provides classes and interfaces for obtaining reflective information about classes and objects. Reflection allows programmatic access to information about the fields, methods and constructors of loaded classes, and the use of reflected fields, methods, and constructors to operate on their underlying counterparts, within encapsulation and security restrictions.
AccessibleObject
allows suppression of access checks if the necessary ReflectPermission
is available.
Array
provides static methods to dynamically create and access arrays.
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.
- Since:
- 1.1
Interface | Description |
---|---|
AnnotatedArrayType |
|
AnnotatedElement | Represents an annotated element of the program currently running in this VM. |
AnnotatedParameterizedType |
|
AnnotatedType |
|
AnnotatedTypeVariable |
|
AnnotatedWildcardType |
|
GenericArrayType |
|
GenericDeclaration | A common interface for all entities that declare type variables. |
InvocationHandler |
|
Member | Member is an interface that reflects identifying information about a single member (a field or a method) or a constructor. |
ParameterizedType | ParameterizedType represents a parameterized type such as Collection<String>. |
Type | Type is the common superinterface for all types in the Java programming language. |
TypeVariable<D extends GenericDeclaration> | TypeVariable is the common superinterface for type variables of kinds. |
WildcardType | WildcardType represents a wildcard type expression, such as |
Class | Description |
---|---|
AccessibleObject | The |
Array | The |
Constructor<T> |
|
Executable | A shared superclass for the common functionality of |
Field | A |
Method | A |
Modifier | The Modifier class provides |
Parameter | Information about method parameters. |
Proxy |
|
ReflectPermission | The Permission class for reflective operations. |
Exception | Description |
---|---|
InaccessibleObjectException | Thrown when Java language access checks cannot be suppressed. |
InvocationTargetException | InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor. |
MalformedParameterizedTypeException | Thrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it. |
MalformedParametersException | Thrown when |
UndeclaredThrowableException | Thrown by a method invocation on a proxy instance if its invocation handler's |
Error | Description |
---|---|
GenericSignatureFormatError | Thrown when a syntactically malformed signature attribute is encountered by a reflective method that needs to interpret the generic signature information for a type, method or constructor. |