| Package | Description |
|---|---|
| java.io | |
| java.lang | |
| java.lang.annotation | |
| java.lang.reflect |
Provides classes and interfaces for obtaining reflective
information about classes and objects.
|
| java.net | |
| java.util |
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
ObjectStreamClass.forClass()
Return the class in the local VM that this version is mapped to.
|
Class<?> |
ObjectStreamField.getType()
Get the type of the field.
|
protected Class<?> |
ObjectInputStream.resolveClass(ObjectStreamClass desc)
Load the local class equivalent of the specified stream class
description.
|
protected Class<?> |
ObjectInputStream.resolveProxyClass(String[] interfaces)
Returns a proxy class that implements the interfaces named in a proxy
class descriptor; subclasses may implement this method to read custom
data from the stream along with the descriptors for dynamic proxy
classes, allowing them to use an alternate loading mechanism for the
interfaces and the proxy class.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
ObjectOutputStream.annotateClass(Class<?> cl)
Subclasses may implement this method to allow class data to be stored in
the stream.
|
protected void |
ObjectOutputStream.annotateProxyClass(Class<?> cl)
Subclasses may implement this method to store custom data in the stream
along with descriptors for dynamic proxy classes.
|
static ObjectStreamClass |
ObjectStreamClass.lookup(Class<?> cl)
Find the descriptor for a class that can be serialized.
|
static ObjectStreamClass |
ObjectStreamClass.lookupAny(Class<?> cl)
Returns the descriptor for any class, regardless of whether it
implements
Serializable. |
| Constructor and Description |
|---|
ObjectStreamField(String name,
Class<?> type)
Create a Serializable field with the specified type.
|
ObjectStreamField(String name,
Class<?> type,
boolean unshared)
Creates an ObjectStreamField representing a serializable field with the
given name and type.
|
| Modifier and Type | Field and Description |
|---|---|
static Class<Void> |
Void.TYPE
The
Class object representing the pseudo-type corresponding to
the keyword void. |
static Class<Short> |
Short.TYPE
The
Class instance representing the primitive type
short. |
static Class<Long> |
Long.TYPE
The
Class instance representing the primitive type
long. |
static Class<Integer> |
Integer.TYPE
The
Class instance representing the primitive type
int. |
static Class<Float> |
Float.TYPE
The
Class instance representing the primitive type
float. |
static Class<Double> |
Double.TYPE
The
Class instance representing the primitive type
double. |
static Class<Character> |
Character.TYPE
The
Class instance representing the primitive type
char. |
static Class<Byte> |
Byte.TYPE
The
Class instance representing the primitive type
byte. |
static Class<Boolean> |
Boolean.TYPE
The Class object representing the primitive type boolean.
|
| Modifier and Type | Method and Description |
|---|---|
<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.defineClass(String name,
byte[] b,
int off,
int len)
Converts an array of bytes into an instance of class Class.
|
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.
|
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<?> |
Object.getClass()
Returns the runtime class of this
Object. |
Class<?> |
Class.getComponentType()
Returns the
Class representing the component type of an
array. |
Class<E> |
Enum.getDeclaringClass()
Returns the Class object corresponding to this enum constant's
enum type.
|
Class<?>[] |
Class.getInterfaces()
Determines the interfaces implemented by the class or interface
represented by this object.
|
Class<? super T> |
Class.getSuperclass()
Returns the
Class representing the 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 and Description |
|---|---|
<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. |
<A extends Annotation> |
Class.getAnnotation(Class<A> annotationClass) |
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) |
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.
|
static <T extends Enum<T>> |
Enum.valueOf(Class<T> enumType,
String name)
Returns the enum constant of the specified enum type with the
specified name.
|
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Annotation> |
Annotation.annotationType()
Returns the annotation type of this annotation.
|
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
Method.getDeclaringClass()
Returns the
Class object representing the class or interface
that declares the method represented by this Method object. |
Class<?> |
Member.getDeclaringClass()
Returns the Class object representing the class or interface
that declares the member or constructor represented by this Member.
|
Class<?> |
Field.getDeclaringClass()
Returns the
Class object representing the class or interface
that declares the field represented by this Field object. |
Class<T> |
Constructor.getDeclaringClass()
Returns the
Class object representing the class that declares
the constructor represented by this Constructor object. |
Class<?>[] |
Method.getExceptionTypes()
Returns an array of
Class objects that represent
the types of the exceptions declared to be thrown
by the underlying method
represented by this Method object. |
Class<?>[] |
Constructor.getExceptionTypes()
Returns an array of
Class objects that represent the types
of exceptions declared to be thrown by the underlying constructor
represented by this Constructor object. |
Class<?>[] |
Method.getParameterTypes()
Returns an array of
Class objects that represent the formal
parameter types, in declaration order, of the method
represented by this Method object. |
Class<?>[] |
Constructor.getParameterTypes()
Returns an array of
Class objects that represent the formal
parameter types, in declaration order, of the constructor
represented by this Constructor object. |
static Class<?> |
Proxy.getProxyClass(ClassLoader loader,
Class<?>... interfaces)
Returns the
java.lang.Class object for a proxy class
given a class loader and an array of interfaces. |
Class<?> |
Method.getReturnType()
Returns a
Class object that represents the formal return type
of the method represented by this Method object. |
Class<?> |
Field.getType()
Returns a
Class object that identifies the
declared type for the field represented by this
Field object. |
| Modifier and Type | Method and Description |
|---|---|
<T extends Annotation> |
Method.getAnnotation(Class<T> annotationClass) |
<T extends Annotation> |
Field.getAnnotation(Class<T> annotationClass) |
<T extends Annotation> |
Constructor.getAnnotation(Class<T> annotationClass) |
<T extends Annotation> |
AnnotatedElement.getAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if
such an annotation is present, else null.
|
<T extends Annotation> |
AccessibleObject.getAnnotation(Class<T> annotationClass) |
static Class<?> |
Proxy.getProxyClass(ClassLoader loader,
Class<?>... interfaces)
Returns the
java.lang.Class object for a proxy class
given a class loader and an array of interfaces. |
boolean |
AnnotatedElement.isAnnotationPresent(Class<? extends Annotation> annotationClass)
Returns true if an annotation for the specified type
is present on this element, else false.
|
boolean |
AccessibleObject.isAnnotationPresent(Class<? extends Annotation> annotationClass) |
static boolean |
Proxy.isProxyClass(Class<?> cl)
Returns true if and only if the specified class was dynamically
generated to be a proxy class using the
getProxyClass
method or the newProxyInstance method. |
static Object |
Array.newInstance(Class<?> componentType,
int... dimensions)
Creates a new array
with the specified component type and dimensions.
|
static Object |
Array.newInstance(Class<?> componentType,
int length)
Creates a new array with the specified component type and
length.
|
static Object |
Proxy.newProxyInstance(ClassLoader loader,
Class<?>[] interfaces,
InvocationHandler h)
Returns an instance of a proxy class for the specified interfaces
that dispatches method invocations to the specified invocation
handler.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
URL.getContent(Class[] classes)
Gets the contents of this URL.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Collection<E> |
Collections.checkedCollection(Collection<E> c,
Class<E> type)
Returns a dynamically typesafe view of the specified collection.
|
static <E> List<E> |
Collections.checkedList(List<E> list,
Class<E> type)
Returns a dynamically typesafe view of the specified list.
|
static <K,V> Map<K,V> |
Collections.checkedMap(Map<K,V> m,
Class<K> keyType,
Class<V> valueType)
Returns a dynamically typesafe view of the specified map.
|
static <K,V> Map<K,V> |
Collections.checkedMap(Map<K,V> m,
Class<K> keyType,
Class<V> valueType)
Returns a dynamically typesafe view of the specified map.
|
static <E> Set<E> |
Collections.checkedSet(Set<E> s,
Class<E> type)
Returns a dynamically typesafe view of the specified set.
|
static <K,V> SortedMap<K,V> |
Collections.checkedSortedMap(SortedMap<K,V> m,
Class<K> keyType,
Class<V> valueType)
Returns a dynamically typesafe view of the specified sorted map.
|
static <K,V> SortedMap<K,V> |
Collections.checkedSortedMap(SortedMap<K,V> m,
Class<K> keyType,
Class<V> valueType)
Returns a dynamically typesafe view of the specified sorted map.
|
static <E> SortedSet<E> |
Collections.checkedSortedSet(SortedSet<E> s,
Class<E> type)
Returns a dynamically typesafe view of the specified sorted set.
|
static <T,U> T[] |
Arrays.copyOf(U[] original,
int newLength,
Class<? extends T[]> newType)
Copies the specified array, truncating or padding with nulls (if necessary)
so the copy has the specified length.
|
static <T,U> T[] |
Arrays.copyOfRange(U[] original,
int from,
int to,
Class<? extends T[]> newType)
Copies the specified range of the specified array into a new array.
|
static <S> ServiceLoader<S> |
ServiceLoader.load(Class<S> service)
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)
Creates a new service loader for the given service type and class
loader.
|
static <S> ServiceLoader<S> |
ServiceLoader.loadInstalled(Class<S> service)
Creates a new service loader for the given service type, using the
extension class loader.
|
Copyright © 2013 API Design. All Rights Reserved.