|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Class<T>
public final class Class<T>
Standard representation of a class, as specified by the standard Java API.
Compliance: CLDC: 1.0 incomplete
newInstance() doesn't throw proper exceptionsCompliance: J2SE: 1.4 incomplete
| Method Summary | ||
|---|---|---|
|
asSubclass(Class<U> clazz)
|
|
T |
cast(Object obj)
|
|
boolean |
desiredAssertionStatus()
|
|
static Class<?> |
forName(String className)
|
|
String |
getCanonicalName()
|
|
ClassLoader |
getClassLoader()
|
|
Class<?> |
getComponentType()
|
|
Constructor<?> |
getConstructor(Class[] parameterTypes)
|
|
Constructor<?>[] |
getConstructors()
|
|
T[] |
getEnumConstants()
|
|
Class[] |
getInterfaces()
|
|
Method |
getMethod(String name,
Class[] parameterTypes)
|
|
Method[] |
getMethods()
|
|
int |
getModifiers()
|
|
String |
getName()
|
|
InputStream |
getResourceAsStream(String name)
Returns a stream for reading a Java resource from the application's bundle file. |
|
String |
getSimpleName()
|
|
Class<? super T> |
getSuperclass()
|
|
boolean |
isAnonymousClass()
|
|
boolean |
isArray()
|
|
boolean |
isAssignableFrom(Class<?> clazz)
|
|
boolean |
isEnum()
|
|
boolean |
isInstance(Object obj)
|
|
boolean |
isInterface()
|
|
boolean |
isPrimitive()
|
|
T |
newInstance()
|
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public String toString()
toString in class Objectpublic String getName()
public T cast(Object obj)
public boolean isInterface()
public Class<? super T> getSuperclass()
public Class[] getInterfaces()
public boolean isAssignableFrom(Class<?> clazz)
public boolean isPrimitive()
public boolean isArray()
public boolean isInstance(Object obj)
public boolean desiredAssertionStatus()
public int getModifiers()
public Method[] getMethods()
throws SecurityException
SecurityException
public Method getMethod(String name,
Class[] parameterTypes)
throws NoSuchMethodException,
SecurityException
NoSuchMethodException
SecurityException
public Constructor<?>[] getConstructors()
throws SecurityException
SecurityException
public Constructor<?> getConstructor(Class[] parameterTypes)
throws NoSuchMethodException,
SecurityException
NoSuchMethodException
SecurityException
public T newInstance()
throws InstantiationException,
IllegalAccessException
InstantiationException
IllegalAccessExceptionpublic ClassLoader getClassLoader()
public static Class<?> forName(String className)
throws ClassNotFoundException
ClassNotFoundExceptionpublic InputStream getResourceAsStream(String name)
getClass().getResourceAsStream(resourceName)
This example, which calls getResourceAsStream on String.class,
WILL FAIL:
"".getClass().getResourceAsStream(resourceName)
name - Path to the resource, relative to the class on which the method is called.
public Class<?> getComponentType()
public boolean isEnum()
public T[] getEnumConstants()
public <U> Class<? extends U> asSubclass(Class<U> clazz)
public String getSimpleName()
public boolean isAnonymousClass()
public String getCanonicalName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||