|
|||||||||
| Home >> All >> java >> [ lang overview ] | PREV NEXT | ||||||||
Uses of Class
java.lang.Class
| Uses of Class in java.lang |
| Fields in java.lang declared as Class | |
private Class[] |
Class.MethodKey.params
|
private Class |
Class.MethodKey.returnType
|
static Class |
Boolean.TYPE
The primitive type boolean is represented by this
Class object. |
static Class |
Character.TYPE
Class object representing the primitive char data type. |
static Class |
Float.TYPE
The primitive type float is represented by this
Class object. |
static Class |
Double.TYPE
The primitive type double is represented by this
Class object. |
static Class |
Byte.TYPE
The primitive type byte is represented by this
Class object. |
static Class |
Short.TYPE
The primitive type short is represented by this
Class object. |
static Class |
Integer.TYPE
The primitive type int is represented by this
Class object. |
static Class |
Long.TYPE
The primitive type long is represented by this
Class object. |
static Class |
Void.TYPE
The return type void is represented by this
Class object. |
private Class |
EnumConstantNotPresentException.enumType
The enum's type. |
| Methods in java.lang that return Class | |
(package private) static Class |
VMObject.getClass(Object obj)
Returns the runtime Class of a given Object. |
(package private) static Class |
VMClass.getSuperclass(Class klass)
Get the direct superclass of this class. |
(package private) static Class[] |
VMClass.getInterfaces(Class klass)
Get the interfaces this class directly implements, in the order that they were declared. |
(package private) static Class |
VMClass.getComponentType(Class klass)
If this is an array, get the Class representing the type of array. |
(package private) static Class |
VMClass.getDeclaringClass(Class klass)
If this is a nested or inner class, return the class that declared it. |
(package private) static Class[] |
VMClass.getDeclaredClasses(Class klass,
boolean publicOnly)
Like getDeclaredClasses() but without the security checks. |
(package private) static Class |
VMClass.forName(String name,
boolean initialize,
ClassLoader loader)
Load the requested class and record the specified loader as the initiating class loader. |
(package private) static Class |
VMClass.getEnclosingClass(Class klass)
Returns the class which immediately encloses the specified class. |
(package private) static Class[] |
VMSecurityManager.getClassContext()
Get a list of all the classes currently executing methods on the Java stack. |
(package private) static Class |
VMClassLoader.defineClass(ClassLoader cl,
String name,
byte[] data,
int offset,
int len,
java.security.ProtectionDomain pd)
Helper to define a class using a string of bytes. |
(package private) static Class |
VMClassLoader.loadClass(String name,
boolean resolve)
Helper to load a class from the bootstrap class loader. |
(package private) static Class |
VMClassLoader.getPrimitiveClass(char type)
Helper for java.lang.Integer, Byte, etc to get the TYPE class at initialization time. |
(package private) static Class |
VMClassLoader.findLoadedClass(ClassLoader cl,
String name)
Find the class if this class loader previously defined this class or if this class loader has been recorded as the initiating class loader for this class. |
(package private) static Class |
VMClassLoader.defineClassWithTransformers(ClassLoader loader,
String name,
byte[] data,
int offset,
int len,
java.security.ProtectionDomain pd)
Call the transformers of the possible Instrumentation object. |
Class |
Object.getClass()
Returns the runtime Class of this Object. |
static Class |
Class.forName(String name)
Use the classloader of the current class to load, link, and initialize a class. |
static Class |
Class.forName(String name,
boolean initialize,
ClassLoader classloader)
Use the specified classloader to load and link a class. |
Class[] |
Class.getClasses()
Get all the public member classes and interfaces declared in this class or inherited from superclasses. |
private Class[] |
Class.internalGetClasses()
Like getClasses() but without the security checks. |
Class |
Class.getComponentType()
If this is an array, get the Class representing the type of array. |
Class[] |
Class.getDeclaredClasses()
Get all the declared member classes and interfaces in this class, but not those inherited from superclasses. |
(package private) Class[] |
Class.getDeclaredClasses(boolean publicOnly)
|
Class |
Class.getDeclaringClass()
If this is a nested or inner class, return the class that declared it. |
Class[] |
Class.getInterfaces()
Get the interfaces this class directly implements, in the order that they were declared. |
Class |
Class.getSuperclass()
Get the direct superclass of this class. |
Class |
Class.asSubclass(Class klass)
Casts this class to represent a subclass of the specified class. |
Class |
Class.getEnclosingClass()
Returns the class which immediately encloses this class. |
Class |
ClassLoader.loadClass(String name)
Load a class using this ClassLoader or its parent, without resolving it. |
protected Class |
ClassLoader.loadClass(String name,
boolean resolve)
Load a class using this ClassLoader or its parent, possibly resolving it as well using resolveClass(). |
protected Class |
ClassLoader.findClass(String name)
Called for every class name that is needed but has not yet been defined by this classloader or one of its parents. |
protected Class |
ClassLoader.defineClass(byte[] data,
int offset,
int len)
Deprecated. use ClassLoader.defineClass(String, byte[], int, int) 55 instead |
protected Class |
ClassLoader.defineClass(String name,
byte[] data,
int offset,
int len)
Helper to define a class using a string of bytes without a ProtectionDomain. |
protected Class |
ClassLoader.defineClass(String name,
byte[] data,
int offset,
int len,
java.security.ProtectionDomain domain)
Helper to define a class using a string of bytes. |
protected Class |
ClassLoader.defineClass(String name,
java.nio.ByteBuffer buf,
java.security.ProtectionDomain domain)
Helper to define a class using the contents of a byte buffer. |
protected Class |
ClassLoader.findSystemClass(String name)
Helper to find a Class using the system classloader, possibly loading it. |
protected Class |
ClassLoader.findLoadedClass(String name)
Helper to find an already-loaded class in this ClassLoader. |
Class |
Enum.getDeclaringClass()
Returns the type of this enumeration constant. |
protected Class[] |
SecurityManager.getClassContext()
Get a list of all the classes currently executing methods on the Java stack. |
protected Class |
SecurityManager.currentLoadedClass()
Deprecated. use SecurityManager.checkPermission(Permission) 55 instead |
Class |
EnumConstantNotPresentException.enumType()
Return the enum type which is missing a constant. |
| Methods in java.lang with parameters of type Class | |
static boolean |
VMCompiler.compileClass(Class oneClass)
Compile the class named by oneClass. |
(package private) static boolean |
VMClass.isInstance(Class klass,
Object o)
Discover whether an Object is an instance of this Class. |
(package private) static boolean |
VMClass.isAssignableFrom(Class klass,
Class c)
Discover whether an instance of the Class parameter would be an instance of this Class as well. |
(package private) static boolean |
VMClass.isInterface(Class klass)
Check whether this class is an interface or not. |
(package private) static boolean |
VMClass.isPrimitive(Class klass)
Return whether this class is a primitive type. |
(package private) static String |
VMClass.getName(Class klass)
Get the name of this class, separated by dots for package separators. |
(package private) static Class |
VMClass.getSuperclass(Class klass)
Get the direct superclass of this class. |
(package private) static Class[] |
VMClass.getInterfaces(Class klass)
Get the interfaces this class directly implements, in the order that they were declared. |
(package private) static Class |
VMClass.getComponentType(Class klass)
If this is an array, get the Class representing the type of array. |
(package private) static int |
VMClass.getModifiers(Class klass,
boolean ignoreInnerClassesAttrib)
Get the modifiers of this class. |
(package private) static Class |
VMClass.getDeclaringClass(Class klass)
If this is a nested or inner class, return the class that declared it. |
(package private) static Class[] |
VMClass.getDeclaredClasses(Class klass,
boolean publicOnly)
Like getDeclaredClasses() but without the security checks. |
(package private) static java.lang.reflect.Field[] |
VMClass.getDeclaredFields(Class klass,
boolean publicOnly)
Like getDeclaredFields() but without the security checks. |
(package private) static java.lang.reflect.Method[] |
VMClass.getDeclaredMethods(Class klass,
boolean publicOnly)
Like getDeclaredMethods() but without the security checks. |
(package private) static java.lang.reflect.Constructor[] |
VMClass.getDeclaredConstructors(Class klass,
boolean publicOnly)
Like getDeclaredConstructors() but without
the security checks. |
(package private) static ClassLoader |
VMClass.getClassLoader(Class klass)
Return the class loader of this class. |
(package private) static boolean |
VMClass.isArray(Class klass)
Return whether this class is an array type. |
(package private) static String |
VMClass.getSimpleName(Class klass)
Returns the simple name for the specified class, as used in the source code. |
(package private) static java.lang.annotation.Annotation[] |
VMClass.getDeclaredAnnotations(Class klass)
Returns all annotations directly defined by the specified class. |
(package private) static String |
VMClass.getCanonicalName(Class klass)
Returns the canonical name of the specified class, as defined by section 6.7 of the Java language specification. |
(package private) static Class |
VMClass.getEnclosingClass(Class klass)
Returns the class which immediately encloses the specified class. |
(package private) static java.lang.reflect.Constructor |
VMClass.getEnclosingConstructor(Class klass)
Returns the constructor which immediately encloses the specified class. |
(package private) static java.lang.reflect.Method |
VMClass.getEnclosingMethod(Class klass)
Returns the method which immediately encloses the specified class. |
(package private) static String |
VMClass.getClassSignature(Class klass)
Returns the class signature as specified in Class File Format chapter in the VM specification, or null if the class is not generic. |
(package private) static boolean |
VMClass.isAnonymousClass(Class klass)
Returns true if the specified class represents an anonymous class. |
(package private) static boolean |
VMClass.isLocalClass(Class klass)
Returns true if the specified class represents an local class. |
(package private) static boolean |
VMClass.isMemberClass(Class klass)
Returns true if the specified class represents an member class. |
(package private) static void |
VMClassLoader.resolveClass(Class c)
Helper to resolve all references to other classes from this class. |
java.lang.reflect.Constructor |
Class.getConstructor(Class[] types)
Get a public constructor declared in this class. |
java.lang.reflect.Constructor |
Class.getDeclaredConstructor(Class[] types)
Get a constructor declared in this class. |
java.lang.reflect.Method |
Class.getDeclaredMethod(String methodName,
Class[] types)
Get a method declared in this class, where name is its simple name. |
java.lang.reflect.Method |
Class.getMethod(String methodName,
Class[] types)
Get a public method declared or inherited in this class, where name is its simple name. |
private java.lang.reflect.Method |
Class.internalGetMethod(String methodName,
Class[] args)
Like getMethod(String,Class[]) but without the security
checks and returns null instead of throwing NoSuchMethodException. |
private static java.lang.reflect.Method |
Class.matchMethod(java.lang.reflect.Method[] list,
String name,
Class[] args)
Find the best matching method in list according to
the definition of ``best matching'' used by getMethod()
|
private static boolean |
Class.matchParameters(Class[] types1,
Class[] types2)
Check for an exact match between parameter type lists. |
boolean |
Class.isAssignableFrom(Class c)
Discover whether an instance of the Class parameter would be an instance of this Class as well. |
Class |
Class.asSubclass(Class klass)
Casts this class to represent a subclass of the specified class. |
java.lang.annotation.Annotation |
Class.getAnnotation(Class annotationClass)
Returns this class' annotation for the specified annotation type, or null if no such annotation exists. |
boolean |
Class.isAnnotationPresent(Class annotationClass)
Returns true if an annotation for the specified type is associated with this class. |
protected void |
ClassLoader.resolveClass(Class c)
Links the class, if that has not already been done. |
protected void |
ClassLoader.setSigners(Class c,
Object[] signers)
Helper to set the signers of a class. |
static boolean |
Compiler.compileClass(Class oneClass)
Compile the class named by oneClass. |
java.lang.annotation.Annotation |
Package.getAnnotation(Class annotationClass)
Returns this package's annotation for the specified annotation type, or null if no such annotation exists. |
boolean |
Package.isAnnotationPresent(Class annotationClass)
Returns true if an annotation for the specified type is associated with this package. |
static Enum |
Enum.valueOf(Class etype,
String s)
Returns an Enum for a enum class given a description string of the enum constant. |
void |
SecurityManager.checkMemberAccess(Class c,
int memberType)
Check if the current thread is allowed to get certain types of Methods, Fields and Constructors from a Class object. |
| Constructors in java.lang with parameters of type Class | |
EnumConstantNotPresentException(Class theEnum,
String name)
Create a new EnumConstantNotPresentException with the indicated enum type and enum constant name. |
|
|
|||||||||
| Home >> All >> java >> [ lang overview ] | PREV NEXT | ||||||||