Package java.lang
Class Class<T>
- java.lang.Object
-
- java.lang.Class<T>
-
- All Implemented Interfaces:
Serializable,Modified
public final class Class<T> extends Object implements Serializable, Modified
The in-memory representation of a Java class. This is maily a stub, as we currently do not support reflection.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Class<?>forName(String className)Returns aClassobject which represents the class with the given name.StringgetName()Returns the name of the class represented by thisClass.StringtoString()Returns a string containing a concise, human-readable description of this object.
-
-
-
Method Detail
-
forName
public static Class<?> forName(String className) throws ClassNotFoundException
Returns aClassobject which represents the class with the given name. The name should be the name of a non-primitive class, as described in theclass definition. Primitive types can not be found using this method; useint.classorInteger.TYPEinstead.If the class has not yet been loaded, it is loaded and initialized first. This is done through either the class loader of the calling class or one of its parent class loaders. It is possible that a static initializer is run as a result of this call.
- Parameters:
className- Name of the class.- Returns:
- Class
- Throws:
ClassNotFoundException- if the requested class can not be found.LinkageError- if an error occurs during linkagejava.lang.ExceptionInInitializerError- if an exception occurs during static initialization of a class.
-
getName
public String getName()
Returns the name of the class represented by thisClass. For a description of the format which is used, see the class definition ofClass.- Returns:
- Name of the class.
-
-