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
B
representing the byte
base type S
representing the short
base type I
representing the int
base type J
representing the long
base type F
representing the float
base type D
representing the double
base type C
representing the char
base type Z
representing the boolean
base type V
representing void function return values int
base type.
Public Member Functions | |
Class[] | getClasses () |
Answers an array containing all public class members of the class which the receiver represents and its superclasses and interfaces. | |
ClassLoader | getClassLoader () |
Answers the classloader 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 | 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. | |
Class[] | getDeclaredClasses () throws SecurityException |
Answers an array containing all class members of the class which the receiver represents. | |
Constructor | 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. | |
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. | |
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. | |
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 | getSuperclass () |
Answers the Class which represents the receiver's superclass. | |
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 | 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 | isPrimitive () |
Answers true if the receiver represents a base type. | |
Object | 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. | |
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. | |
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. | |
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 Package Attributes | |
static final long | serialVersionUID = 3206093459760846163L |
|
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 java.lang.Class, however Classes representing base types can not be found using this method.
|
|
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 java.lang.Class, however Classes representing base types can not be found using this method. Security rules will be obeyed.
|
|
Answers an array containing all public class members of the class which the receiver represents and its superclasses and interfaces.
|
|
Verify the specified Class using the VM byte code verifier.
|
|
Answers the classloader which was used to load the class represented by the receiver. Answer null if the class was loaded by the system class loader
|
|
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.
|
|
Answers a Class object which represents the receiver's component type if the receiver represents an array type. Otherwise answers nil. The component type of an array type is the type of the elements of the array.
|
|
Answers a public Constructor object which represents the constructor described by the arguments.
|
|
Answers an array containing Constructor objects describing all constructors which are visible from the current execution context.
|
|
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.
|
|
Answers a Constructor object which represents the constructor described by the arguments.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Answers the class which declared the class represented by the receiver. This will return null if the receiver is a member of another class.
|
|
Answers a Field object describing the field in the receiver named by the argument which must be visible from the current execution context.
|
|
Answers an array containing Field objects describing all fields which are visible from the current execution context.
|
|
Answers an array of Class objects which match the interfaces specified in the receiver classes
|
|
Answers a Method object which represents the method described by the arguments.
|
|
Answers an array containing Method objects describing all methods which are visible from the current execution context.
|
|
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 java.lang.reflect.Modifier which may not be available on the target.
|
|
Answers the name of the class which the receiver represents. For a description of the format which is used, see the class definition of java.lang.Class.
|
|
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.
|
|
Answers the ProtectionDomain of the receiver. This method is for internal use only.
|
|
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.
|
|
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.
|
|
Answers the signers for the class represented by the receiver, or null if there are no signers.
|
|
Answers the Class which represents the receiver's superclass. For Classes which represent base types, interfaces, and for java.lang.Object the method answers null.
|
|
Answers true if the receiver represents an array class.
|
|
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).
|
|
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
|
|
Answers true if the receiver represents an interface.
|
|
Answers true if the receiver represents a base type.
|
|
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.
|
|
Answers a string containing a concise, human-readable description of the receiver.
|
|
Returns the Package of which this class is a member. A class has a Package iff it was loaded from a SecureClassLoader
|
|
Returns the assertion status for this class. Assertion is enabled/disabled based on classloader default, package or class default at runtime
|
|
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:
|