|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
totalcross.lang.Objecttotalcross.lang.Class
public final class Class
This class contains utility methods that are used to load classes by name
and get information about their fields and methods.
IMPORTANT: the totalcross.lang package is the java.lang that will be used in the device.
You CANNOT use nor import totalcross.lang package in desktop. When tc.Deploy is called,
all references to java.lang are replaced by totalcross.lang automatically. Given this,
you must use only the classes and methods that exists BOTH in java.lang and totalcross.lang.
For example, you can't use totalcross.lang.ClassLoader because there are no totalcross.lang.ClassLoader.
Another example, you can't use totalcross.lang.String.indexOfIgnoreCase because there are no
totalcross.lang.String.indexOfIgnoreCase method. Trying to use a class or method from the java.lang package
that has no correspondence with totalcross.lang will make the tc.Deploy program to abort, informing
where the problem occured. A good idea is to always refer to this javadoc to know what is and what isn't
available.
| Constructor Summary | |
|---|---|
Class()
|
|
| Method Summary | |
|---|---|
static Class |
forName(String className)
The TotalCross deployer can find classes that are instantiated using Class.forName if, and only if, they are totalcross.lang.String constants. |
totalcross.lang.reflect.Field |
getField(String name)
Not implemented under the TotalCross VM! |
totalcross.lang.reflect.Method |
getMethod(String name,
Class[] parameterTypes)
Not implemented under the TotalCross VM! |
String |
getName()
Returns the fully qualified name of this class. |
Object |
getResourceAsStream(String name)
Not implemented under the TotalCross VM! |
Class |
getSuperclass()
Not implemented under the TotalCross VM! |
boolean |
isInstance(Object obj)
Returns true if the given object is an instance of this class. |
Object |
newInstance()
Creates a new instance of this class. |
String |
toString()
Returns the fully qualified name of this class. |
| Methods inherited from class totalcross.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Class()
| Method Detail |
|---|
public static Class forName(String className)
throws ClassNotFoundException
ClassNotFoundExceptionVm.attachLibrary(totalcross.lang.String)
public Object newInstance()
throws totalcross.lang.InstantiationException,
totalcross.lang.IllegalAccessException
InstantiationException - If you try to instantiate an interface, abstract class or array
IllegalAccessException - If you try to instantiate a private class
totalcross.lang.InstantiationException
totalcross.lang.IllegalAccessExceptionpublic boolean isInstance(Object obj)
public String getName()
public String toString()
public Object getResourceAsStream(String name)
public totalcross.lang.reflect.Method getMethod(String name,
Class[] parameterTypes)
public Class getSuperclass()
public totalcross.lang.reflect.Field getField(String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||