java.lang.Class< T > Class Reference

List of all members.


Detailed Description

This class must be implemented by the VM vendor.

The documented natives must be implemented to support other provided class implementations in this package. An instance of class Class is the in-image representation of a Java class. There are three basic types of Classes

Classes representing object types (classes or interfaces)
These are Classes which represent the class of a simple instance as found in the class hierarchy. The name of one of these Classes is simply the fully qualified class name of the class or interface that it represents. Its signature is the letter "L", followed by its name, followed by a semi-colon (";").
Classes representing base types
These Classes represent the standard Java base types. Although it is not possible to create new instances of these Classes, they are still useful for providing reflection information, and as the component type of array classes. There is one of these Classes for each base type, and their signatures are: The name of a Class representing a base type is the keyword which is used to represent the type in Java source code (i.e. "int" for the int base type.
Classes representing array classes
These are Classes which represent the classes of Java arrays. There is one such Class for all array instances of a given arity (number of dimensions) and leaf component type. In this case, the name of the class is one or more left square brackets (one per dimension in the array) followed by the signature ofP the class representing the leaf component type, which can be either an object type or a base type. The signature of a Class representing an array type is the same as its name.

Since:
1.0

Public Member Functions

Class[] getClasses ()
 Answers an array containing all public class members of the class which the receiver represents and its super classes and interfaces.
Annotation[] getAnnotations ()
 Answers all the annotations of the receiver.
String getCanonicalName ()
 Answers the canonical name of the receiver.
ClassLoader getClassLoader ()
 Answers the class loader which was used to load the class represented by the receiver.
Class<?> getComponentType ()
 Answers a Class object which represents the receiver's component type if the receiver represents an array type.
Constructor< T > getConstructor (Class...parameterTypes) throws NoSuchMethodException, SecurityException
 Answers a public Constructor object which represents the constructor described by the arguments.
Constructor[] getConstructors () throws SecurityException
 Answers an array containing Constructor objects describing all constructors which are visible from the current execution context.
Annotation[] getDeclaredAnnotations ()
 Answers the annotations that are directly defined on this type.
Class[] getDeclaredClasses () throws SecurityException
 Answers an array containing all class members of the class which the receiver represents.
Constructor< T > getDeclaredConstructor (Class...parameterTypes) throws NoSuchMethodException, SecurityException
 Answers a Constructor object which represents the constructor described by the arguments.
Constructor[] getDeclaredConstructors () throws SecurityException
 Answers an array containing Constructor objects describing all constructor which are defined by the receiver.
Field getDeclaredField (String name) throws NoSuchFieldException, SecurityException
 Answers a Field object describing the field in the receiver named by the argument.
Field[] getDeclaredFields () throws SecurityException
 Answers an array containing Field objects describing all fields which are defined by the receiver.
Method getDeclaredMethod (String name, Class...parameterTypes) throws NoSuchMethodException, SecurityException
 Answers a Method object which represents the method described by the arguments.
Method[] getDeclaredMethods () throws SecurityException
 Answers an array containing Method objects describing all methods which are defined by the receiver.
Class<?> getDeclaringClass ()
 Answers the class which declared the class represented by the receiver.
Class<?> getEnclosingClass ()
 Answers the class that directly encloses the receiver.
Constructor<?> getEnclosingConstructor ()
 Gets the Constructor, which encloses the declaration of this class, if it is an anonymous or local/automatic class, otherwise null.
Method getEnclosingMethod ()
 Gets the Method, which encloses the declaration of this class, if it is an anonymous or local/automatic class, otherwise null.
T[] getEnumConstants ()
 Gets the enum constants/fields associated with this class if it is an isEnum() enum}, otherwise null.
Field getField (String name) throws NoSuchFieldException, SecurityException
 Answers a Field object describing the field in the receiver named by the argument which must be visible from the current execution context.
Field[] getFields () throws SecurityException
 Answers an array containing Field objects describing all fields which are visible from the current execution context.
Type[] getGenericInterfaces ()
 Gets the types of the interface that this class directly implements.
Type getGenericSuperclass ()
 Gets the Type that represents the super class of this class.
Class[] getInterfaces ()
 Answers an array of Class objects which match the interfaces specified in the receiver classes implements declaration.
Method getMethod (String name, Class...parameterTypes) throws NoSuchMethodException, SecurityException
 Answers a Method object which represents the method described by the arguments.
Method[] getMethods () throws SecurityException
 Answers an array containing Method objects describing all methods which are visible from the current execution context.
int getModifiers ()
 Answers an integer which which is the receiver's modifiers.
String getName ()
 Answers the name of the class which the receiver represents.
String getSimpleName ()
 Answers the simple name of the receiver as defined in the source code.
ProtectionDomain getProtectionDomain ()
 Answers the ProtectionDomain of the receiver.
URL getResource (String resName)
 Answers a read-only stream on the contents of the resource specified by resName.
InputStream getResourceAsStream (String resName)
 Answers a read-only stream on the contents of the resource specified by resName.
Object[] getSigners ()
 Answers the signers for the class represented by the receiver, or null if there are no signers.
Class<?super T > getSuperclass ()
 Answers the Class which represents the receiver's superclass.
TypeVariable< Class< T > >[] getTypeParameters ()
 Gets the type variables associated with this class.
boolean isAnnotation ()
 Indicates whether or not this class is an annotation.
boolean isAnnotationPresent (Class<?extends Annotation > annotationClass)
 Indicates whether or not the given annotation is present for this class.
boolean isAnonymousClass ()
 Indicates whether or not this class was anonymously declared.
boolean isArray ()
 Answers true if the receiver represents an array class.
boolean isAssignableFrom (Class<?> cls)
 Answers true if the type represented by the argument can be converted via an identity conversion or a widening reference conversion (i.e.
boolean isEnum ()
 Indicates whether or not this class is an enum.
boolean isInstance (Object object)
 Answers true if the argument is non-null and can be cast to the type of the receiver.
boolean isInterface ()
 Answers true if the receiver represents an interface.
boolean isLocalClass ()
 Answers whether the receiver is defined locally.
boolean isMemberClass ()
 Answers whether the receiver is a member class.
boolean isPrimitive ()
 Answers true if the receiver represents a base type.
boolean isSynthetic ()
 Answers whether the receiver is a synthetic type.
newInstance () throws IllegalAccessException, InstantiationException
 Answers a new instance of the class represented by the receiver, created by invoking the default (i.e.
String toString ()
 Answers a string containing a concise, human-readable description of the receiver.
Package getPackage ()
 Returns the Package of which this class is a member.
boolean desiredAssertionStatus ()
 Returns the assertion status for this class.
cast (Object obj)
 Cast the given object to the type T.

Static Public Member Functions

static Class<?> forName (String className) throws ClassNotFoundException
 Answers a Class object which represents the class named by the argument.
static Class<?> forName (String className, boolean initializeBoolean, ClassLoader classLoader) throws ClassNotFoundException
 Answers a Class object which represents the class named by the argument.

Package Functions

void verify ()
 Verify the specified Class using the VM byte code verifier.
public< A extends Annotation > A getAnnotation (Class< A > annotationClass)
 Answers the annotation of the given type.
ClassLoader getClassLoaderImpl ()
 This must be provided by the VM vendor, as it is used by other provided class implementations in this package.
ProtectionDomain getPDImpl ()
 Answers the ProtectionDomain of the receiver.
public< U > Class<?extends U > asSubclass (Class< U > clazz)
 Casts the receiver to a subclass of the given class.

Static Package Functions

static final Class[] getStackClasses (int maxDepth, boolean stopAtPrivileged)
 This must be provided by the VM vendor, as it is used by other provided class implementations in this package.

Static Private Attributes

static final long serialVersionUID = 3206093459760846163L

Member Function Documentation

static final Class [] java.lang.Class< T >.getStackClasses ( int  maxDepth,
boolean  stopAtPrivileged 
) [static, package]

This must be provided by the VM vendor, as it is used by other provided class implementations in this package.

This method is used by SecurityManager.classDepth(), and getClassContext() which use the parameters (-1, false) and SecurityManager.classLoaderDepth(), currentClassLoader(), and currentLoadedClass() which use the parameters (-1, true). Walk the stack and answer an array containing the maxDepth most recent classes on the stack of the calling thread. Starting with the caller of the caller of getStackClasses(), return an array of not more than maxDepth Classes representing the classes of running methods on the stack (including native methods). Frames representing the VM implementation of java.lang.reflect are not included in the list. If stopAtPrivileged is true, the walk will terminate at any frame running one of the following methods:

If one of the doPrivileged methods is found, the walk terminate and that frame is NOT included in the returned array. Notes:

Parameters:
maxDepth maximum depth to walk the stack, -1 for the entire stack
stopAtPrivileged stop at privileged classes
Returns:
the array of the most recent classes on the stack

static Class<?> java.lang.Class< T >.forName ( String  className  )  throws ClassNotFoundException [static]

Answers a Class object which represents the class named by the argument.

The name should be the name of a class as described in the class definition of Class, however Classes representing base types can not be found using this method.

Parameters:
className The name of the non-base type class to find
Returns:
the named Class
Exceptions:
ClassNotFoundException If the class could not be found

static Class<?> java.lang.Class< T >.forName ( String  className,
boolean  initializeBoolean,
ClassLoader  classLoader 
) throws ClassNotFoundException [static]

Answers a Class object which represents the class named by the argument.

The name should be the name of a class as described in the class definition of Class, however Classes representing base types can not be found using this method. Security rules will be obeyed.

Parameters:
className The name of the non-base type class to find
initializeBoolean A boolean indicating whether the class should be initialized
classLoader The class loader to use to load the class
Returns:
the named class.
Exceptions:
ClassNotFoundException If the class could not be found

Class [] java.lang.Class< T >.getClasses (  ) 

Answers an array containing all public class members of the class which the receiver represents and its super classes and interfaces.

Returns:
the class' public class members
Exceptions:
SecurityException If member access is not allowed

void java.lang.Class< T >.verify (  )  [package]

Verify the specified Class using the VM byte code verifier.

Exceptions:
VerifyError if the Class cannot be verified

public<A extends Annotation> A java.lang.Class< T >.getAnnotation ( Class< A >  annotationClass  )  [package]

Answers the annotation of the given type.

If there is no annotation the method returns null.

Parameters:
annotationClass the annotation type.
Returns:
the annotation of the given type, or null if none.
Since:
1.5

Annotation [] java.lang.Class< T >.getAnnotations (  ) 

Answers all the annotations of the receiver.

If there are no annotations then answers an empty array.

Returns:
a copy of the array containing the receiver's annotations.

String java.lang.Class< T >.getCanonicalName (  ) 

Answers the canonical name of the receiver.

If the receiver does not have a canonical name, as defined in the Java Language Specification, then the method returns null.

Returns:
the receiver canonical name, or null.

ClassLoader java.lang.Class< T >.getClassLoader (  ) 

Answers the class loader which was used to load the class represented by the receiver.

Answer null if the class was loaded by the system class loader

Returns:
the receiver's class loader or null

ClassLoader java.lang.Class< T >.getClassLoaderImpl (  )  [package]

This must be provided by the VM vendor, as it is used by other provided class implementations in this package.

Outside of this class, it is used by SecurityManager.checkMemberAccess(), classLoaderDepth(), currentClassLoader() and currentLoadedClass(). Return the ClassLoader for this Class without doing any security checks. The bootstrap ClassLoader is returned, unlike getClassLoader() which returns null in place of the bootstrap ClassLoader.

Returns:
the ClassLoader
See also:
ClassLoader.isSystemClassLoader()

Class<?> java.lang.Class< T >.getComponentType (  ) 

Answers a Class object which represents the receiver's component type if the receiver represents an array type.

Otherwise answers null. The component type of an array type is the type of the elements of the array.

Returns:
the component type of the receiver.

Constructor<T> java.lang.Class< T >.getConstructor ( Class< T >...  parameterTypes  )  throws NoSuchMethodException, SecurityException

Answers a public Constructor object which represents the constructor described by the arguments.

Parameters:
parameterTypes the types of the arguments.
Returns:
the constructor described by the arguments.
Exceptions:
NoSuchMethodException if the constructor could not be found.
SecurityException if member access is not allowed
See also:
getConstructors

Constructor [] java.lang.Class< T >.getConstructors (  )  throws SecurityException

Answers an array containing Constructor objects describing all constructors which are visible from the current execution context.

Returns:
all visible constructors starting from the receiver.
Exceptions:
SecurityException if member access is not allowed
See also:
getMethods

Annotation [] java.lang.Class< T >.getDeclaredAnnotations (  ) 

Answers the annotations that are directly defined on this type.

Annotations that are inherited are not included in the result. If there are no annotations, returns an empty array.

Returns:
a copy of the array containing the receiver's defined annotations.
Since:
1.5

Class [] java.lang.Class< T >.getDeclaredClasses (  )  throws SecurityException

Answers an array containing all class members of the class which the receiver represents.

Note that some of the fields which are returned may not be visible in the current execution context.

Returns:
the class' class members
Exceptions:
SecurityException if member access is not allowed

Constructor<T> java.lang.Class< T >.getDeclaredConstructor ( Class< T >...  parameterTypes  )  throws NoSuchMethodException, SecurityException

Answers a Constructor object which represents the constructor described by the arguments.

Parameters:
parameterTypes the types of the arguments.
Returns:
the constructor described by the arguments.
Exceptions:
NoSuchMethodException if the constructor could not be found.
SecurityException if member access is not allowed
See also:
getConstructors

Constructor [] java.lang.Class< T >.getDeclaredConstructors (  )  throws SecurityException

Answers an array containing Constructor objects describing all constructor which are defined by the receiver.

Note that some of the fields which are returned may not be visible in the current execution context.

Returns:
the receiver's constructors.
Exceptions:
SecurityException if member access is not allowed
See also:
getMethods

Field java.lang.Class< T >.getDeclaredField ( String  name  )  throws NoSuchFieldException, SecurityException

Answers a Field object describing the field in the receiver named by the argument.

Note that the Constructor may not be visible from the current execution context.

Parameters:
name The name of the field to look for.
Returns:
the field in the receiver named by the argument.
Exceptions:
NoSuchFieldException if the requested field could not be found
SecurityException if member access is not allowed
See also:
getDeclaredFields

Field [] java.lang.Class< T >.getDeclaredFields (  )  throws SecurityException

Answers an array containing Field objects describing all fields which are defined by the receiver.

Note that some of the fields which are returned may not be visible in the current execution context.

Returns:
the receiver's fields.
Exceptions:
SecurityException If member access is not allowed
See also:
getFields

Method java.lang.Class< T >.getDeclaredMethod ( String  name,
Class< T >...  parameterTypes 
) throws NoSuchMethodException, SecurityException

Answers a Method object which represents the method described by the arguments.

Note that the associated method may not be visible from the current execution context.

Parameters:
name the name of the method
parameterTypes the types of the arguments.
Returns:
the method described by the arguments.
Exceptions:
NoSuchMethodException if the method could not be found.
SecurityException If member access is not allowed
NullPointerException if the name parameter is null.
See also:
getMethods

Method [] java.lang.Class< T >.getDeclaredMethods (  )  throws SecurityException

Answers an array containing Method objects describing all methods which are defined by the receiver.

Note that some of the methods which are returned may not be visible in the current execution context.

Exceptions:
SecurityException if member access is not allowed
Returns:
the receiver's methods.
See also:
getMethods

Class<?> java.lang.Class< T >.getDeclaringClass (  ) 

Answers the class which declared the class represented by the receiver.

This will return null if the receiver is a member of another class.

Returns:
the declaring class of the receiver.

Class<?> java.lang.Class< T >.getEnclosingClass (  ) 

Answers the class that directly encloses the receiver.

If there is no enclosing class the method returns null.

Returns:
the enclosing class or null.

Constructor<?> java.lang.Class< T >.getEnclosingConstructor (  ) 

Gets the Constructor, which encloses the declaration of this class, if it is an anonymous or local/automatic class, otherwise null.

Returns:
A Constructor instance or null.
Since:
1.5

Method java.lang.Class< T >.getEnclosingMethod (  ) 

Gets the Method, which encloses the declaration of this class, if it is an anonymous or local/automatic class, otherwise null.

Returns:
A Method instance or null.
Since:
1.5

T [] java.lang.Class< T >.getEnumConstants (  ) 

Gets the enum constants/fields associated with this class if it is an isEnum() enum}, otherwise null.

Returns:
An array of the enum constants for this class or null.
Since:
1.5

Field java.lang.Class< T >.getField ( String  name  )  throws NoSuchFieldException, SecurityException

Answers a Field object describing the field in the receiver named by the argument which must be visible from the current execution context.

Parameters:
name The name of the field to look for.
Returns:
the field in the receiver named by the argument.
Exceptions:
NoSuchFieldException If the given field does not exist
SecurityException If access is denied
See also:
getDeclaredFields

Field [] java.lang.Class< T >.getFields (  )  throws SecurityException

Answers an array containing Field objects describing all fields which are visible from the current execution context.

Returns:
all visible fields starting from the receiver.
Exceptions:
SecurityException If member access is not allowed
See also:
getDeclaredFields

Type [] java.lang.Class< T >.getGenericInterfaces (  ) 

Gets the types of the interface that this class directly implements.

Returns:
An array of Type instances.
Since:
1.5

Type java.lang.Class< T >.getGenericSuperclass (  ) 

Gets the Type that represents the super class of this class.

Returns:
An instance of Type
Since:
1.5

Class [] java.lang.Class< T >.getInterfaces (  ) 

Answers an array of Class objects which match the interfaces specified in the receiver classes implements declaration.

Returns:
Class[] the interfaces the receiver claims to implement.

Method java.lang.Class< T >.getMethod ( String  name,
Class< T >...  parameterTypes 
) throws NoSuchMethodException, SecurityException

Answers a Method object which represents the method described by the arguments.

Parameters:
name String the name of the method
parameterTypes Class[] the types of the arguments.
Returns:
Method the method described by the arguments.
Exceptions:
NoSuchMethodException if the method could not be found.
SecurityException if member access is not allowed
See also:
getMethods

Method [] java.lang.Class< T >.getMethods (  )  throws SecurityException

Answers an array containing Method objects describing all methods which are visible from the current execution context.

Returns:
Method[] all visible methods starting from the receiver.
Exceptions:
SecurityException if member access is not allowed
See also:
getDeclaredMethods

int java.lang.Class< T >.getModifiers (  ) 

Answers an integer which which is the receiver's modifiers.

Note that the constants which describe the bits which are returned are implemented in class Modifier which may not be available on the target.

Returns:
the receiver's modifiers

String java.lang.Class< T >.getName (  ) 

Answers the name of the class which the receiver represents.

For a description of the format which is used, see the class definition of Class.

Returns:
the receiver's name.

String java.lang.Class< T >.getSimpleName (  ) 

Answers the simple name of the receiver as defined in the source code.

If there is no name (the class is anonymous) returns an empty string, and if the receiver is an array returns the name of the underlying type with square braces appended (e.g. "Integer[]").

Returns:
the simple name of the receiver.

ProtectionDomain java.lang.Class< T >.getProtectionDomain (  ) 

Answers the ProtectionDomain of the receiver.

Note: In order to conserve space in embedded targets, we allow this method to answer null for classes in the system protection domain (i.e. for system classes). System classes are always given full permissions (i.e. AllPermission). This is not changeable via the java.security.Policy.

Returns:
ProtectionDomain the receiver's ProtectionDomain.

ProtectionDomain java.lang.Class< T >.getPDImpl (  )  [package]

Answers the ProtectionDomain of the receiver.

This method is for internal use only.

Returns:
ProtectionDomain the receiver's ProtectionDomain.

URL java.lang.Class< T >.getResource ( String  resName  ) 

Answers a read-only stream on the contents of the resource specified by resName.

The mapping between the resource name and the stream is managed by the class' class loader.

Parameters:
resName the name of the resource.
Returns:
a stream on the resource.
See also:
ClassLoader

InputStream java.lang.Class< T >.getResourceAsStream ( String  resName  ) 

Answers a read-only stream on the contents of the resource specified by resName.

The mapping between the resource name and the stream is managed by the class' class loader.

Parameters:
resName the name of the resource.
Returns:
a stream on the resource.
See also:
ClassLoader

Object [] java.lang.Class< T >.getSigners (  ) 

Answers the signers for the class represented by the receiver, or null if there are no signers.

Returns:
the signers of the receiver.
See also:
getMethods

Class<? super T> java.lang.Class< T >.getSuperclass (  ) 

Answers the Class which represents the receiver's superclass.

For Classes which represent base types, interfaces, and for Object the method answers null.

Returns:
the receiver's superclass.

TypeVariable<Class<T> > [] java.lang.Class< T >.getTypeParameters (  ) 

Gets the type variables associated with this class.

Returns:
An array of TypeVariable instances.
Since:
1.5

boolean java.lang.Class< T >.isAnnotation (  ) 

Indicates whether or not this class is an annotation.

Returns:
A value of true if this class is an annotation, otherwise false.
Since:
1.5

boolean java.lang.Class< T >.isAnnotationPresent ( Class<?extends Annotation >  annotationClass  ) 

Indicates whether or not the given annotation is present for this class.

Parameters:
annotationClass The annotation to look for in this class.
Returns:
A value of true if the annotation is present, otherwise false.
Since:
1.5

boolean java.lang.Class< T >.isAnonymousClass (  ) 

Indicates whether or not this class was anonymously declared.

Returns:
A value of true if this class is anonymous, otherwise false.
Since:
1.5

boolean java.lang.Class< T >.isArray (  ) 

Answers true if the receiver represents an array class.

Returns:
true if the receiver represents an array class false if it does not represent an array class

boolean java.lang.Class< T >.isAssignableFrom ( Class<?>  cls  ) 

Answers true if the type represented by the argument can be converted via an identity conversion or a widening reference conversion (i.e.

if either the receiver or the argument represent primitive types, only the identity conversion applies).

Returns:
true the argument can be assigned into the receiver false the argument cannot be assigned into the receiver
Parameters:
cls Class the class to test
Exceptions:
NullPointerException if the parameter is null

boolean java.lang.Class< T >.isEnum (  ) 

Indicates whether or not this class is an enum.

Returns:
A value of true if this class is an Enum, otherwise false.
Since:
1.5

boolean java.lang.Class< T >.isInstance ( Object  object  ) 

Answers true if the argument is non-null and can be cast to the type of the receiver.

This is the runtime version of the instanceof operator.

Returns:
true the argument can be cast to the type of the receiver false the argument is null or cannot be cast to the type of the receiver
Parameters:
object Object the object to test

boolean java.lang.Class< T >.isInterface (  ) 

Answers true if the receiver represents an interface.

Returns:
true if the receiver represents an interface false if it does not represent an interface

boolean java.lang.Class< T >.isLocalClass (  ) 

Answers whether the receiver is defined locally.

Returns:
true if the class is local, otherwise false.

boolean java.lang.Class< T >.isMemberClass (  ) 

Answers whether the receiver is a member class.

Returns:
true if the class is a member class, otherwise false.

boolean java.lang.Class< T >.isPrimitive (  ) 

Answers true if the receiver represents a base type.

Returns:
true if the receiver represents a base type false if it does not represent a base type

boolean java.lang.Class< T >.isSynthetic (  ) 

Answers whether the receiver is a synthetic type.

Returns:
true if the receiver is a synthetic type and false otherwise.

T java.lang.Class< T >.newInstance (  )  throws IllegalAccessException, InstantiationException

Answers a new instance of the class represented by the receiver, created by invoking the default (i.e.

zero-argument) constructor. If there is no such constructor, or if the creation fails (either because of a lack of available memory or because an exception is thrown by the constructor), an InstantiationException is thrown. If the default constructor exists, but is not accessible from the context where this message is sent, an IllegalAccessException is thrown.

Returns:
a new instance of the class represented by the receiver.
Exceptions:
IllegalAccessException if the constructor is not visible to the sender.
InstantiationException if the instance could not be created.

String java.lang.Class< T >.toString (  ) 

Answers a string containing a concise, human-readable description of the receiver.

Returns:
a printable representation for the receiver.

Package java.lang.Class< T >.getPackage (  ) 

Returns the Package of which this class is a member.

A class has a Package if it was loaded from a SecureClassLoader

Returns:
Package the Package of which this class is a member or null

boolean java.lang.Class< T >.desiredAssertionStatus (  ) 

Returns the assertion status for this class.

Assertion is enabled/disabled based on class loader default, package or class default at runtime

Returns:
the assertion status for this class

public<U> Class<? extends U> java.lang.Class< T >.asSubclass ( Class< U >  clazz  )  [package]

Casts the receiver to a subclass of the given class.

If successful answers the receiver, otherwise if the cast cannot be made throws a ClassCastException.

Parameters:
clazz the required type.
Returns:
this class cast as a subclass of the given type.
Exceptions:
ClassCastException if the class cannot be cast to the given type.

T java.lang.Class< T >.cast ( Object  obj  ) 

Cast the given object to the type T.

If the object is null the result is also null.

Parameters:
obj the object to cast
Returns:
The object that has been cast.
Exceptions:
ClassCastException if the object cannot be cast to the given type.


The documentation for this class was generated from the following file:

Genereated on Tue Dec 9 14:09:47 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.