API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.lang. Class View Source
Author(s)
unascribed
Since
JDK1.0
Version
1.201, 08/07/06
Serial
Hierarchy
 Object
      Class
Implements
 Serializable
 GenericDeclaration
 Type
 AnnotatedElement
Subclasses
Description
publicfinal class Class
  Instances of the class Class represent classes and interfaces in a running Java application.
Constructors
private Class ()
Methods
Hide/Show inherited methods
public Class<Object> asSubclass (Class< U> clazz)
  Casts this Class object to represent a subclass of the class represented by the specified class object.
public T cast (Object obj)
  Casts an object to the class or interface represented by this Class object.
public boolean desiredAssertionStatus ()
  Returns the assertion status that would be assigned to this class if it were to be initialized at the time this method is invoked.
pack-private Map<String, T> enumConstantDirectory ()
  Returns a map from simple name to enum constant.
publicstatic Class<Object> forName (String className) throws ClassNotFoundException
  Returns the Class object associated with the class or interface with the given string name.
publicstatic Class<Object> forName (String name, boolean initialize, ClassLoader loader) throws ClassNotFoundException
  Returns the Class object associated with the class or interface with the given string name, using the given class loader.
public A getAnnotation (Class< A> annotationClass)
 
public Annotation getAnnotations () [Specified in AnnotatedElement]
 
pack-private sun.reflect.annotation.AnnotationType getAnnotationType ()
public String getCanonicalName ()
  Returns the canonical name of the underlying class as defined by the Java Language Specification.
public Class<Object> 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.
public ClassLoader getClassLoader ()
  Returns the class loader for the class.
pack-privatenative ClassLoader getClassLoader0 ()
publicnative Class<Object> getComponentType ()
  Returns the Class representing the component type of an array.
pack-privatenative sun.reflect.ConstantPool getConstantPool ()
public Constructor< T> getConstructor (Class<Object> parameterTypes) throws NoSuchMethodException SecurityException
  Returns a Constructor object that reflects the specified public constructor of the class represented by this Class object.
public Constructor<Object> getConstructors () throws SecurityException
  Returns an array containing Constructor objects reflecting all the public constructors of the class represented by this Class object.
public Annotation getDeclaredAnnotations () [Specified in AnnotatedElement]
 
public Class<Object> getDeclaredClasses () throws SecurityException
  Returns an array of Class objects reflecting all the classes and interfaces declared as members of the class represented by this Class object.
public Constructor< T> getDeclaredConstructor (Class<Object> parameterTypes) throws NoSuchMethodException SecurityException
  Returns a Constructor object that reflects the specified constructor of the class or interface represented by this Class object.
public Constructor<Object> getDeclaredConstructors () throws SecurityException
  Returns an array of Constructor objects reflecting all the constructors declared by the class represented by this Class object.
public Field getDeclaredField (String name) throws NoSuchFieldException SecurityException
  Returns a Field object that reflects the specified declared field of the class or interface represented by this Class object.
public Field getDeclaredFields () throws SecurityException
  Returns an array of Field objects reflecting all the fields declared by the class or interface represented by this Class object.
public Method getDeclaredMethod (String name, Class<Object> parameterTypes) throws NoSuchMethodException SecurityException
  Returns a Method object that reflects the specified declared method of the class or interface represented by this Class object.
public Method getDeclaredMethods () throws SecurityException
  Returns an array of Method objects reflecting all the methods declared by the class or interface represented by this Class object.
publicnative Class<Object> 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.
public Class<Object> getEnclosingClass ()
  Returns the immediately enclosing class of the underlying class.
public Constructor<Object> getEnclosingConstructor ()
  If this Class object represents a local or anonymous class within a constructor, returns a Constructor object representing the immediately enclosing constructor of the underlying class.
public Method getEnclosingMethod ()
  If this Class object represents a local or anonymous class within a method, returns a Method object representing the immediately enclosing method of the underlying class.
public T getEnumConstants ()
  Returns the elements of this enum class or null if this Class object does not represent an enum type.
pack-private T getEnumConstantsShared ()
Returns the elements of this enum class or null if this Class object does not represent an enum type; identical to getEnumConstantsShared except that the result is uncloned, cached, and shared by all callers.
public Field getField (String name) throws NoSuchFieldException SecurityException
  Returns a Field object that reflects the specified public member field of the class or interface represented by this Class object.
public Field getFields () throws SecurityException
  Returns an array containing Field objects reflecting all the accessible public fields of the class or interface represented by this Class object.
public Type getGenericInterfaces ()
  Returns the Types representing the interfaces directly implemented by the class or interface represented by this object.
public Type getGenericSuperclass ()
  Returns the Type representing the direct superclass of the entity (class, interface, primitive type or void) represented by this Class.
publicnative Class<Object> getInterfaces ()
  Determines the interfaces implemented by the class or interface represented by this object.
public Method getMethod (String name, Class<Object> parameterTypes) throws NoSuchMethodException SecurityException
  Returns a Method object that reflects the specified public member method of the class or interface represented by this Class object.
public Method getMethods () throws SecurityException
  Returns an array containing Method objects reflecting all the public member methods of the class or interface represented by this Class object, including those declared by the class or interface and those inherited from superclasses and superinterfaces.
publicnative int getModifiers ()
  Returns the Java language modifiers for this class or interface, encoded in an integer.
public String getName ()
  Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this Class object, as a String.
public Package getPackage ()
  Gets the package for this class.
pack-privatestaticnative Class getPrimitiveClass (String name)
public ProtectionDomain getProtectionDomain ()
  Returns the ProtectionDomain of this class.
public URL getResource (String name)
  Finds a resource with a given name.
public InputStream getResourceAsStream (String name)
  Finds a resource with a given name.
publicnative Object getSigners ()
  Gets the signers of this class.
public String getSimpleName ()
  Returns the simple name of the underlying class as given in the source code.
publicnative Class<Object> getSuperclass ()
  Returns the Class representing the superclass of the entity (class, interface, primitive type or void) represented by this Class.
public TypeVariable<Class< T>> getTypeParameters () [Specified in GenericDeclaration]
  Returns an array of TypeVariable objects that represent the type variables declared by the generic declaration represented by this GenericDeclaration object, in declaration order.
public boolean isAnnotation ()
  Returns true if this Class object represents an annotation type.
public boolean isAnnotationPresent (Class<Annotation> annotationClass) [Specified in AnnotatedElement]
 
public boolean isAnonymousClass ()
  Returns true if and only if the underlying class is an anonymous class.
publicnative boolean isArray ()
  Determines if this Class object represents an array class.
publicnative boolean isAssignableFrom (Class<Object> 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.
public boolean isEnum ()
  Returns true if and only if this class was declared as an enum in the source code.
publicnative boolean isInstance (Object obj)
  Determines if the specified Object is assignment-compatible with the object represented by this Class.
publicnative boolean isInterface ()
  Determines if the specified Class object represents an interface type.
public boolean isLocalClass ()
  Returns true if and only if the underlying class is a local class.
public boolean isMemberClass ()
  Returns true if and only if the underlying class is a member class.
publicnative boolean isPrimitive ()
  Determines if the specified Class object represents a primitive type.
public boolean isSynthetic ()
  Returns true if this class is a synthetic class; returns false otherwise.
public T newInstance () throws InstantiationException IllegalAccessException
  Creates a new instance of the class represented by this Class object.
pack-private void setAnnotationType (sun.reflect.annotation.AnnotationType type)
pack-privatenative void setProtectionDomain0 (ProtectionDomain pd)
  Set the ProtectionDomain for this class.
pack-privatenative void setSigners (Object signers)
Set the signers of this class.
public String toString ()
  Converts the object to a string.
Fields
Hide/Show inherited fields
Nested Classes
  Class.MethodArray
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar