Package | Description |
---|---|
java.lang |
REVISED Provides classes that are fundamental to the design of the Java
programming language.
|
java.lang.instrument |
REVISED Provides services that allow Java programming language agents to instrument
programs running on the JVM.
|
java.lang.invoke |
REVISED The
java.lang.invoke package contains dynamic language support provided directly by
the Java core class libraries and virtual machine. |
java.lang.reflect |
REVISED Provides classes and interfaces for obtaining reflective information about
classes and objects.
|
java.net |
REVISED Provides the classes for implementing networking applications.
|
java.security |
REVISED Provides the classes and interfaces for the security framework.
|
java.util |
REVISED Contains the collections framework, some internationalization support classes,
a service loader, properties, random number generation, string parsing
and scanning classes, base64 encoding and decoding, a bit array, and
several miscellaneous utility classes.
|
javax.lang.model.element |
REVISED Interfaces used to model elements of the Java programming language.
|
javax.tools |
REVISED Provides interfaces for tools which can be invoked from a program,
for example, compilers.
|
Modifier and Type | Method | Description |
---|---|---|
protected Class<?> |
ClassLoader.defineClass(String name,
byte[] b,
int off,
int len) |
REVISED Converts an array of bytes into an instance of class
Class . |
protected Class<?> |
ClassLoader.defineClass(String name,
byte[] b,
int off,
int len,
ProtectionDomain protectionDomain) |
REVISED Converts an array of bytes into an instance of class
Class ,
with a given ProtectionDomain . |
protected Class<?> |
ClassLoader.defineClass(String name,
ByteBuffer b,
ProtectionDomain protectionDomain) |
|
protected Class<?> |
ClassLoader.findClass(String moduleName,
String name) |
NEW Finds the class with the given binary name
in a module defined to this class loader.
|
static Class<?> |
Class.forName(Module module,
String name) |
|
<U> Class<? extends U> |
Class.asSubclass(Class<U> clazz) |
Casts this
Class object to represent a subclass of the class
represented by the specified class object. |
protected Class<?> |
ClassLoader.defineClass(byte[] b,
int off,
int len) |
Deprecated.
Replaced by
defineClass(String, byte[], int, int) |
protected Class<?> |
ClassLoader.findClass(String name) |
Finds the class with the specified binary name.
|
protected Class<?> |
ClassLoader.findLoadedClass(String name) |
Returns the class with the given binary name if this
loader has been recorded by the Java virtual machine as an initiating
loader of a class with that binary name.
|
protected Class<?> |
ClassLoader.findSystemClass(String name) |
Finds a class with the specified binary name,
loading it if necessary.
|
static Class<?> |
Class.forName(String className) |
Returns the
Class object associated with the class or
interface with the given string name. |
static Class<?> |
Class.forName(String name,
boolean initialize,
ClassLoader loader) |
Returns the
Class object associated with the class or
interface with the given string name, using the given class loader. |
Class<?>[] |
Class.getClasses() |
Returns an array containing
Class objects representing all
the public classes and interfaces that are members of the class
represented by this Class object. |
Class<?> |
Class.getComponentType() |
Returns the
Class representing the component type of an
array. |
Class<?>[] |
Class.getDeclaredClasses() |
Returns an array of
Class objects reflecting all the
classes and interfaces declared as members of the class represented by
this Class object. |
Class<?> |
Class.getDeclaringClass() |
If the class or interface represented by this
Class object
is a member of another class, returns the Class object
representing the class in which it was declared. |
Class<?> |
Class.getEnclosingClass() |
Returns the immediately enclosing class of the underlying
class.
|
Class<?>[] |
Class.getInterfaces() |
Returns the interfaces directly implemented by the class or interface
represented by this object.
|
Class<? super T> |
Class.getSuperclass() |
Returns the
Class representing the direct superclass of the
entity (class, interface, primitive type or void) represented by
this Class . |
Class<?> |
ClassLoader.loadClass(String name) |
Loads the class with the specified binary name.
|
protected Class<?> |
ClassLoader.loadClass(String name,
boolean resolve) |
Loads the class with the specified binary name.
|
Modifier and Type | Method | Description |
---|---|---|
TypeVariable<Class<T>>[] |
Class.getTypeParameters() |
Returns an array of
TypeVariable objects that represent the
type variables declared by the generic declaration represented by this
GenericDeclaration object, in declaration order. |
Modifier and Type | Method | Description |
---|---|---|
Module |
Module.addUses(Class<?> service) |
If the caller's module is this module then update this module to add a
service dependence on the given service type.
|
<U> Class<? extends U> |
Class.asSubclass(Class<U> clazz) |
Casts this
Class object to represent a subclass of the class
represented by the specified class object. |
boolean |
Module.canUse(Class<?> service) |
Indicates if this module has a service dependence on the given service
type.
|
<A extends Annotation> |
Class.getAnnotation(Class<A> annotationClass) |
|
<T extends Annotation> |
Module.getAnnotation(Class<T> annotationClass) |
Returns this element's annotation for the specified type if
such an annotation is present, else null.
|
<A extends Annotation> |
Package.getAnnotation(Class<A> annotationClass) |
|
<A extends Annotation> |
Class.getAnnotationsByType(Class<A> annotationClass) |
|
<A extends Annotation> |
Package.getAnnotationsByType(Class<A> annotationClass) |
|
Constructor<T> |
Class.getConstructor(Class<?>... parameterTypes) |
Returns a
Constructor object that reflects the specified
public constructor of the class represented by this Class
object. |
<A extends Annotation> |
Class.getDeclaredAnnotation(Class<A> annotationClass) |
|
<A extends Annotation> |
Package.getDeclaredAnnotation(Class<A> annotationClass) |
|
<A extends Annotation> |
Class.getDeclaredAnnotationsByType(Class<A> annotationClass) |
|
<A extends Annotation> |
Package.getDeclaredAnnotationsByType(Class<A> annotationClass) |
|
Constructor<T> |
Class.getDeclaredConstructor(Class<?>... parameterTypes) |
Returns a
Constructor object that reflects the specified
constructor of the class or interface represented by this
Class object. |
Method |
Class.getDeclaredMethod(String name,
Class<?>... parameterTypes) |
Returns a
Method object that reflects the specified
declared method of the class or interface represented by this
Class object. |
Method |
Class.getMethod(String name,
Class<?>... parameterTypes) |
Returns a
Method object that reflects the specified public
member method of the class or interface represented by this
Class object. |
boolean |
Class.isAnnotationPresent(Class<? extends Annotation> annotationClass) |
Returns true if an annotation for the specified type
is present on this element, else false.
|
boolean |
Package.isAnnotationPresent(Class<? extends Annotation> annotationClass) |
Returns true if an annotation for the specified type
is present on this element, else false.
|
boolean |
Class.isAssignableFrom(Class<?> cls) |
Determines if the class or interface represented by this
Class object is either the same as, or is a superclass or
superinterface of, the class or interface represented by the specified
Class parameter. |
protected void |
ClassLoader.resolveClass(Class<?> c) |
Links the specified class.
|
protected void |
ClassLoader.setSigners(Class<?> c,
Object[] signers) |
Sets the signers of a class.
|
Modifier and Type | Method | Description |
---|---|---|
Class[] |
Instrumentation.getAllLoadedClasses() |
Returns an array of all classes currently loaded by the JVM.
|
Class[] |
Instrumentation.getInitiatedClasses(ClassLoader loader) |
Returns an array of all classes for which
loader is an initiating loader. |
Modifier and Type | Method | Description |
---|---|---|
default byte[] |
ClassFileTransformer.transform(ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
REVISED Transforms the given class file and returns a new replacement class file.
|
default byte[] |
ClassFileTransformer.transform(Module module,
ClassLoader loader,
String className,
Class<?> classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer) |
NEW Transforms the given class file and returns a new replacement class file.
|
boolean |
Instrumentation.isModifiableClass(Class<?> theClass) |
Tests whether a class is modifiable by
retransformation
or redefinition.
|
void |
Instrumentation.retransformClasses(Class<?>... classes) |
Retransform the supplied set of classes.
|
Modifier and Type | Method | Description |
---|---|---|
Class<?> |
MethodHandles.Lookup.defineClass(byte[] bytes) |
NEW Defines a class to the same class loader and in the same runtime package and
protection domain as this lookup's
lookup class.
|
Class<?> |
MethodHandles.Lookup.accessClass(Class<?> targetClass) |
Determines if a class can be accessed from the lookup context defined by this
Lookup object. |
Class<?> |
MethodHandles.Lookup.findClass(String targetName) |
Looks up a class by name from the lookup context defined by this
Lookup object. |
Class<?> |
MethodHandles.Lookup.lookupClass() |
Tells which class is performing the lookup.
|
Modifier and Type | Method | Description |
---|---|---|
MethodHandles.Lookup |
MethodHandles.Lookup.in(Class<?> requestedLookupClass) |
REVISED Creates a lookup on the specified new lookup class.
|
static MethodHandles.Lookup |
MethodHandles.privateLookupIn(Class<?> targetClass,
MethodHandles.Lookup lookup) |
NEW Returns a
lookup object with full capabilities to emulate all
supported bytecode behaviors, including
private access, on a target class. |
Class<?> |
MethodHandles.Lookup.accessClass(Class<?> targetClass) |
Determines if a class can be accessed from the lookup context defined by this
Lookup object. |
static MethodHandle |
MethodHandles.arrayConstructor(Class<?> arrayClass) |
Produces a method handle constructing arrays of a desired type.
|
static MethodHandle |
MethodHandles.arrayElementGetter(Class<?> arrayClass) |
Produces a method handle giving read access to elements of an array.
|
static MethodHandle |
MethodHandles.arrayElementSetter(Class<?> arrayClass) |
Produces a method handle giving write access to elements of an array.
|
static VarHandle |
MethodHandles.arrayElementVarHandle(Class<?> arrayClass) |
Produces a VarHandle giving access to elements of an array of type
arrayClass . |
static MethodHandle |
MethodHandles.arrayLength(Class<?> arrayClass) |
Produces a method handle returning the length of an array.
|
static VarHandle |
MethodHandles.byteArrayViewVarHandle(Class<?> viewArrayClass,
ByteOrder byteOrder) |
Produces a VarHandle giving access to elements of a
byte[] array
viewed as if it were a different primitive array type, such as
int[] or long[] . |
static VarHandle |
MethodHandles.byteBufferViewVarHandle(Class<?> viewArrayClass,
ByteOrder byteOrder) |
Produces a VarHandle giving access to elements of a
ByteBuffer
viewed as if it were an array of elements of a different primitive
component type to that of byte , such as int[] or
long[] . |
static MethodHandle |
MethodHandles.catchException(MethodHandle target,
Class<? extends Throwable> exType,
MethodHandle handler) |
Makes a method handle which adapts a target method handle,
by running it inside an exception handler.
|
static MethodHandle |
MethodHandles.constant(Class<?> type,
Object value) |
Produces a method handle of the requested return type which returns the given
constant value every time it is invoked.
|
static MethodHandle |
MethodHandles.dropArguments(MethodHandle target,
int pos,
Class<?>... valueTypes) |
Produces a method handle which will discard some dummy arguments
before calling some other specified target method handle.
|
MethodHandle |
MethodHandles.Lookup.findConstructor(Class<?> refc,
MethodType type) |
Produces a method handle which creates an object and initializes it, using
the constructor of the specified type.
|
MethodHandle |
MethodHandles.Lookup.findGetter(Class<?> refc,
String name,
Class<?> type) |
Produces a method handle giving read access to a non-static field.
|
MethodHandle |
MethodHandles.Lookup.findSetter(Class<?> refc,
String name,
Class<?> type) |
Produces a method handle giving write access to a non-static field.
|
MethodHandle |
MethodHandles.Lookup.findSpecial(Class<?> refc,
String name,
MethodType type,
Class<?> specialCaller) |
Produces an early-bound method handle for a virtual method.
|
MethodHandle |
MethodHandles.Lookup.findStatic(Class<?> refc,
String name,
MethodType type) |
Produces a method handle for a static method.
|
MethodHandle |
MethodHandles.Lookup.findStaticGetter(Class<?> refc,
String name,
Class<?> type) |
Produces a method handle giving read access to a static field.
|
MethodHandle |
MethodHandles.Lookup.findStaticSetter(Class<?> refc,
String name,
Class<?> type) |
Produces a method handle giving write access to a static field.
|
VarHandle |
MethodHandles.Lookup.findStaticVarHandle(Class<?> decl,
String name,
Class<?> type) |
Produces a VarHandle giving access to a static field
name of
type type declared in a class of type decl . |
VarHandle |
MethodHandles.Lookup.findVarHandle(Class<?> recv,
String name,
Class<?> type) |
Produces a VarHandle giving access to a non-static field
name
of type type declared in a class of type recv . |
MethodHandle |
MethodHandles.Lookup.findVirtual(Class<?> refc,
String name,
MethodType type) |
Produces a method handle for a virtual method.
|
static MethodHandle |
MethodHandles.identity(Class<?> type) |
Produces a method handle which returns its sole argument when invoked.
|
static <T extends Member> |
MethodHandles.reflectAs(Class<T> expected,
MethodHandle target) |
Performs an unchecked "crack" of a
direct method handle.
|
static MethodHandle |
MethodHandles.throwException(Class<?> returnType,
Class<? extends Throwable> exType) |
Produces a method handle which will throw exceptions of the given
exType . |
MethodHandle |
MethodHandles.Lookup.unreflectSpecial(Method m,
Class<?> specialCaller) |
Produces a method handle for a reflected method.
|
static MethodHandle |
MethodHandles.zero(Class<?> type) |
Produces a constant method handle of the requested return type which
returns the default value for that type every time it is invoked.
|
Modifier and Type | Method | Description |
---|---|---|
static MethodHandle |
MethodHandles.dropArguments(MethodHandle target,
int pos,
List<Class<?>> valueTypes) |
Produces a method handle which will discard some dummy arguments
before calling some other specified target method handle.
|
static MethodHandle |
MethodHandles.dropArgumentsToMatch(MethodHandle target,
int skip,
List<Class<?>> newTypes,
int pos) |
Adapts a target method handle to match the given parameter type list.
|
Modifier and Type | Method | Description |
---|---|---|
static Class<?> |
Proxy.getProxyClass(ClassLoader loader,
Class<?>... interfaces) |
Deprecated.
REVISED Proxy classes generated in a named module are encapsulated
and not accessible to code outside its module.
Constructor.newInstance
will throw IllegalAccessException when it is called on
an inaccessible proxy class.
Use Proxy.newProxyInstance(ClassLoader, Class[], InvocationHandler)
to create a proxy instance instead. |
Modifier and Type | Method | Description |
---|---|---|
static Class<?> |
Proxy.getProxyClass(ClassLoader loader,
Class<?>... interfaces) |
Deprecated.
REVISED Proxy classes generated in a named module are encapsulated
and not accessible to code outside its module.
Constructor.newInstance
will throw IllegalAccessException when it is called on
an inaccessible proxy class.
Use Proxy.newProxyInstance(ClassLoader, Class[], InvocationHandler)
to create a proxy instance instead. |
static boolean |
Proxy.isProxyClass(Class<?> cl) |
REVISED Returns true if the given class is a proxy class.
|
static Object |
Proxy.newProxyInstance(ClassLoader loader,
Class<?>[] interfaces,
InvocationHandler h) |
REVISED Returns a proxy instance for the specified interfaces
that dispatches method invocations to the specified invocation
handler.
|
<T extends Annotation> |
AccessibleObject.getAnnotation(Class<T> annotationClass) |
|
<T extends Annotation> |
AccessibleObject.getAnnotationsByType(Class<T> annotationClass) |
|
<T extends Annotation> |
AccessibleObject.getDeclaredAnnotation(Class<T> annotationClass) |
|
<T extends Annotation> |
AccessibleObject.getDeclaredAnnotationsByType(Class<T> annotationClass) |
|
boolean |
AccessibleObject.isAnnotationPresent(Class<? extends Annotation> annotationClass) |
Returns true if an annotation for the specified type
is present on this element, else false.
|
Modifier and Type | Method | Description |
---|---|---|
protected Class<?> |
URLClassLoader.findClass(String name) |
Finds and loads the class with the specified name from the URL search
path.
|
Modifier and Type | Method | Description |
---|---|---|
protected Class<?> |
SecureClassLoader.defineClass(String name,
byte[] b,
int off,
int len,
CodeSource cs) |
Converts an array of bytes into an instance of class Class,
with an optional CodeSource.
|
protected Class<?> |
SecureClassLoader.defineClass(String name,
ByteBuffer b,
CodeSource cs) |
Converts a
ByteBuffer
into an instance of class Class , with an optional CodeSource. |
Modifier and Type | Method | Description |
---|---|---|
Class<? extends S> |
ServiceLoader.Provider.type() |
Returns the provider type.
|
Modifier and Type | Method | Description |
---|---|---|
static <S> ServiceLoader<S> |
ServiceLoader.load(Class<S> service) |
REVISED Creates a new service loader for the given service type, using the
current thread's context class loader.
|
static <S> ServiceLoader<S> |
ServiceLoader.load(Class<S> service,
ClassLoader loader) |
REVISED Creates a new service loader for the given service.
|
static <S> ServiceLoader<S> |
ServiceLoader.load(ModuleLayer layer,
Class<S> service) |
NEW Creates a new service loader for the given service type to load service
providers from modules in the given module layer and its ancestors.
|
static <S> ServiceLoader<S> |
ServiceLoader.loadInstalled(Class<S> service) |
REVISED Creates a new service loader for the given service type, using the
platform class loader.
|
Modifier and Type | Method | Description |
---|---|---|
<A extends Annotation> |
Element.getAnnotation(Class<A> annotationType) |
Returns this construct's annotation of the specified type if
such an annotation is present, else
null . |
Modifier and Type | Method | Description |
---|---|---|
<S> ServiceLoader<S> |
ForwardingJavaFileManager.getServiceLoader(JavaFileManager.Location location,
Class<S> service) |
NEW
|
default <S> ServiceLoader<S> |
JavaFileManager.getServiceLoader(JavaFileManager.Location location,
Class<S> service) |
NEW Get a service loader for a specific service class from a given location.
|
Copyright © 1993, 2017, Oracle and/or its affiliates · All rights reserved · License