|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Class
| Constructor Summary | |
protected |
Class()
|
| Method Summary | |
boolean |
equals(Object other)
Returns if this object is considered equal to the other object. |
static Class |
forName(String className)
This attempts to load a Class given the class name. |
ClassLoader |
getClassLoader()
Under Ewe this will either return a valid ClassLoader or null if the class was loaded by the normal bootstrap (VM) loader. |
Class |
getComponentType()
Return a Class representing the component type IF this class represents an array. |
Constructor |
getConstructor(Class[] parameterTypes)
|
Constructor[] |
getConstructors()
|
Class[] |
getDeclaredClasses()
This returns an array of Classes representing all the named inner classes declared by this class. |
Constructor |
getDeclaredConstructor(Class[] parameterTypes)
|
Constructor[] |
getDeclaredConstructors()
|
Field |
getDeclaredField(String name)
|
Field[] |
getDeclaredFields()
|
Method |
getDeclaredMethod(String name,
Class[] parameterTypes)
|
Method[] |
getDeclaredMethods()
|
Field |
getField(String name)
|
Field[] |
getFields()
|
Class[] |
getInterfaces()
Returns an array of interface implemented by this class. |
Method |
getMethod(String name,
Class[] parameterTypes)
|
Method[] |
getMethods()
|
int |
getModifiers()
|
String |
getName()
Return the name of the class in dot notation (e.g. |
Object[] |
getSigners()
This currently always returns an array of zero length as signers are not currently supported. |
Class |
getSuperclass()
Return the superclass of the represented class. |
int |
hashCode()
Returns a hashCode for the object. |
boolean |
isArray()
Returns true if the class represents an array. |
boolean |
isAssignableFrom(Class other)
Returns true if the this class is a superclass or superinterface of the specified other class. |
boolean |
isInstance(Object obj)
This is the equivalent of the instanceof operator. |
boolean |
isInterface()
Returns true if this class represents an interface. |
boolean |
isPrimitive()
Checks if this class represents a primitive type. |
Object |
newInstance()
|
String |
toString()
Return a String representation of this object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass |
| Constructor Detail |
protected Class()
| Method Detail |
public String getName()
public String toString()
Object
toString in class Objectpublic ClassLoader getClassLoader()
public static Class forName(String className)
throws ClassNotFoundException
To obtain a Class for an array using forName you must provide a name in the form: "[Java_Type" where Java_Type is one of:
'Z' - boolean
'B' - byte
'C' - char
'S' - short
'I' - int
'J' - long
'D' - double
'F' - float
"Lfull_class_name;" - class (e.g.: Ljava.lang.String)
When specifying an array of Objects using "[Lfull_class_name;" if the class full_class_name could not be found a ClassNotFoundException will be thrown.
To get a Class that represents a primitive type call forName() to get a Class representing the array of the primitive type, and then call getComponentType() on that returned class. For example:
Class intClass = Class.forName("[I").getComponentType();
ClassNotFoundExceptionpublic boolean equals(Object other)
Object
equals in class Objectother - Another object to compare to.
public Class getSuperclass()
public Class[] getInterfaces()
public boolean isInterface()
public boolean isAssignableFrom(Class other)
public boolean isInstance(Object obj)
public boolean isPrimitive()
public boolean isArray()
public Class getComponentType()
public int hashCode()
Object
hashCode in class Objectpublic Object[] getSigners()
public int getModifiers()
public Class[] getDeclaredClasses()
public Object newInstance()
throws InstantiationException,
IllegalAccessException
InstantiationException
IllegalAccessException
public Field getField(String name)
throws NoSuchFieldException,
SecurityException
NoSuchFieldException
SecurityException
public Field getDeclaredField(String name)
throws NoSuchFieldException,
SecurityException
NoSuchFieldException
SecurityException
public Field[] getFields()
throws SecurityException
SecurityException
public Field[] getDeclaredFields()
throws SecurityException
SecurityException
public Method getMethod(String name,
Class[] parameterTypes)
throws NoSuchMethodException,
SecurityException
NoSuchMethodException
SecurityException
public Method[] getMethods()
throws SecurityException
SecurityException
public Method getDeclaredMethod(String name,
Class[] parameterTypes)
throws NoSuchMethodException,
SecurityException
NoSuchMethodException
SecurityException
public Method[] getDeclaredMethods()
throws SecurityException
SecurityException
public Constructor getConstructor(Class[] parameterTypes)
throws NoSuchMethodException,
SecurityException
NoSuchMethodException
SecurityException
public Constructor[] getConstructors()
throws SecurityException
SecurityException
public Constructor getDeclaredConstructor(Class[] parameterTypes)
throws NoSuchMethodException,
SecurityException
NoSuchMethodException
SecurityException
public Constructor[] getDeclaredConstructors()
throws SecurityException
SecurityException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||