class_interface.h File Reference


Typedefs

typedef Class_ * class_handler
 Define class handler.
typedef Field_ * field_handler
 Define field handler.
typedef Method_ * method_handler
 Define method handler.
typedef ClassLoader_ * classloader_handler
 Define class loader handler.

Enumerations

enum  ClassConstantPoolTags {
  _CONSTANT_Unknown = 0, _CONSTANT_Utf8 = 1, _CONSTANT_Integer = 3, _CONSTANT_Float = 4,
  _CONSTANT_Long = 5, _CONSTANT_Double = 6, _CONSTANT_Class = 7, _CONSTANT_String = 8,
  _CONSTANT_Fieldref = 9, _CONSTANT_Methodref = 10, _CONSTANT_InterfaceMethodref = 11, _CONSTANT_NameAndType = 12
}
 Enum of constant pool tags. More...

Functions

unsigned short class_get_version (class_handler klass)
 Function returns class major version.
const char * class_get_name (class_handler klass)
 Function returns class name.
classloader_handler class_get_class_loader (class_handler klass)
 Function returns class loader.
class_handler class_get_super_class (class_handler klass)
 Function returns super class of current class.
unsigned class_is_same_class (class_handler klass1, class_handler klass2)
 Function checks if classes are equal.
unsigned class_is_same_package (class_handler klass1, class_handler klass2)
 Function checks if classes have the same package.
unsigned class_is_interface_ (class_handler klass)
 Function checks if current class is interface.
unsigned class_is_array (class_handler klass)
 Function checks if current class is array.
unsigned class_is_final_ (class_handler klass)
 Function checks if current class is final.
unsigned short class_get_superinterface_number (class_handler klass)
 Function receives number of super interfaces of class.
class_handler class_get_superinterface (class_handler klass, unsigned short index)
 Function receives super interface of class.
class_handler class_get_array_element_class (class_handler klass)
 Function receives element class of array class.
class_handler class_is_extending_class (class_handler klass, const char *super_name)
 Function checks if class extends current class with given name.
unsigned short class_get_method_number (class_handler klass)
 Function returns number of methods for current class.
method_handler class_get_method (class_handler klass, unsigned short index)
 Function returns method of current class.
unsigned short class_get_cp_size (class_handler klass)
 Function returns class constant pool size.
unsigned char class_get_cp_tag (class_handler klass, unsigned short index)
 Function returns constant pool entry tag.
unsigned short class_get_cp_class_name_index (class_handler klass, unsigned short index)
 Function returns class name entry index in constant pool.
unsigned short class_get_cp_ref_class_index (class_handler klass, unsigned short index)
 Function returns class name entry index in constant pool.
unsigned short class_get_cp_ref_name_and_type_index (class_handler klass, unsigned short index)
 Function returns name_and_type entry index in constant pool.
unsigned short class_get_cp_string_index (class_handler klass, unsigned short index)
 Function returns string entry index in constant pool.
unsigned short class_get_cp_name_index (class_handler klass, unsigned short index)
 Function returns name entry index in constant pool.
unsigned short class_get_cp_descriptor_index (class_handler klass, unsigned short index)
 Function returns descriptor entry index in constant pool.
const char * class_get_cp_utf8_bytes (class_handler klass, unsigned short index)
 Function returns bytes for UTF8 constant pool entry.
void class_set_verify_data_ptr (class_handler klass, void *data)
 Function sets verify data to a given class.
void * class_get_verify_data_ptr (class_handler klass)
 Function returns verify data for a given class.
method_handler class_resolve_method (class_handler klass, unsigned short index)
 Function resolves class nonstatic method for constant pool entry.
field_handler class_resolve_nonstatic_field (class_handler klass, unsigned short index)
 Function resolves class nonstatic field for constant pool entry.
class_handler method_get_class (method_handler hmethod)
 Function returns a class in which the method is declared.
const char * method_get_name (method_handler method)
 Function returns method name.
const char * method_get_descriptor (method_handler method)
 Function returns method descriptor.
unsigned method_get_code_length (method_handler method)
 Function returns method code length.
unsigned char * method_get_bytecode (method_handler method)
 Function returns method bytecode array.
unsigned short method_get_max_local (method_handler method)
 Function returns maximal local variables number of method.
unsigned short method_get_max_stack (method_handler method)
 Function returns maximal stack deep of method.
unsigned method_is_static (method_handler method)
 Function checks if method is static.
unsigned method_is_protected (method_handler method)
 Function checks if a given method is protected.
unsigned short method_get_exc_handler_number (method_handler method)
 Function returns number of method exception handlers.
void method_get_exc_handler_info (method_handler method, unsigned short index, unsigned short *start_pc, unsigned short *end_pc, unsigned short *handler_pc, unsigned short *catch_type)
 Function obtains method exception handler info.
unsigned short method_get_number_exc_method_can_throw (method_handler hmethod)
 Gets number of exceptions a method can throw.
const char * method_get_exc_method_can_throw (method_handler hmethod, unsigned short index)
 Gets name of exception a method can throw.
unsigned char * method_get_stackmaptable (method_handler hmethod)
 Gets StackMapTable attribute.
void cl_set_verify_data_ptr (classloader_handler classloader, void *data)
 Function sets verify data in class loader.
void * cl_get_verify_data_ptr (classloader_handler classloader)
 Function returns verify data in class loader.
void cl_acquire_lock (classloader_handler classloader)
 Function locks class loader.
void cl_release_lock (classloader_handler classloader)
 Function releases class loader.
class_handler cl_get_class (classloader_handler classloader, const char *name)
 Function returns loaded class in class loader.
class_handler cl_load_class (classloader_handler classloader, const char *name)
 Function returns loaded class in class loader.
unsigned field_is_protected (field_handler field)
 Function checks if the field is protected.


Typedef Documentation

typedef struct Class_* class_handler

Define class handler.

typedef struct Field_* field_handler

Define field handler.

typedef struct Method_* method_handler

Define method handler.

typedef struct ClassLoader_* classloader_handler

Define class loader handler.


Enumeration Type Documentation

enum ClassConstantPoolTags

Enum of constant pool tags.

Enumerator:
_CONSTANT_Unknown 
_CONSTANT_Utf8 
_CONSTANT_Integer 
_CONSTANT_Float 
_CONSTANT_Long 
_CONSTANT_Double 
_CONSTANT_Class 
_CONSTANT_String 
_CONSTANT_Fieldref 
_CONSTANT_Methodref 
_CONSTANT_InterfaceMethodref 
_CONSTANT_NameAndType 


Function Documentation

unsigned short class_get_version ( class_handler  klass  ) 

Function returns class major version.

Parameters:
klass - class handler
Returns:
Class name bytes.
Note:
Assertion is raised if klass is equal to null.

const char* class_get_name ( class_handler  klass  ) 

Function returns class name.

Parameters:
klass - class handler
Returns:
Class name bytes.
Note:
Assertion is raised if klass is equal to null.

classloader_handler class_get_class_loader ( class_handler  klass  ) 

Function returns class loader.

Parameters:
klass - class handler
Returns:
Class class loader handler.
Note:
Assertion is raised if klass is equal to null.

class_handler class_get_super_class ( class_handler  klass  ) 

Function returns super class of current class.

Parameters:
klass - class handler
Returns:
Super class of current class.
Note:
Assertion is raised if klass is equal to null.

unsigned class_is_same_class ( class_handler  klass1,
class_handler  klass2 
)

Function checks if classes are equal.

Parameters:
klass1 - class handler
klass2 - class handler
Returns:
If classes are equal returns true, else returns false.
Note:
Assertion is raised if klass1 or klass2 are equal to null.

unsigned class_is_same_package ( class_handler  klass1,
class_handler  klass2 
)

Function checks if classes have the same package.

Parameters:
klass1 - class handler
klass2 - class handler
Returns:
If classes have the same package returns true, else returns false.
Note:
Assertion is raised if klass1 or klass2 are equal to null.

unsigned class_is_interface_ ( class_handler  klass  ) 

Function checks if current class is interface.

Parameters:
klass - class handler
Returns:
If class is interface returns true, else returns false.
Note:
Assertion is raised if klass is equal to null.

unsigned class_is_array ( class_handler  klass  ) 

Function checks if current class is array.

Parameters:
klass - class handler
Returns:
If class is array returns true, else returns false.
Note:
Assertion is raised if klass is equal to null.

unsigned class_is_final_ ( class_handler  klass  ) 

Function checks if current class is final.

Parameters:
klass - class handler
Returns:
If class is final returns true, else returns false.
Note:
Assertion is raised if klass is equal to null.

unsigned short class_get_superinterface_number ( class_handler  klass  ) 

Function receives number of super interfaces of class.

Parameters:
klass - class handler
Returns:
Number of super interfaces of class.
Note:
Assertion is raised if klass is equal to null.

class_handler class_get_superinterface ( class_handler  klass,
unsigned short  index 
)

Function receives super interface of class.

Parameters:
klass - class handler
index - super interface number
Returns:
Super interface of class.
Note:
Assertion is raised if klass is equal to null or index is out of range.

class_handler class_get_array_element_class ( class_handler  klass  ) 

Function receives element class of array class.

Parameters:
klass - class handler
Returns:
Element class of array class.
Note:
Assertion is raised if klass is equal to null or isn't array class.

class_handler class_is_extending_class ( class_handler  klass,
const char *  super_name 
)

Function checks if class extends current class with given name.

Parameters:
klass - checked klass
super_name - parent class name
Returns:
If given class extends current class with given name, function returns its class handler, else function returns 0.
Note:
Assertion is raised if klass or super_name are equal to null.

unsigned short class_get_method_number ( class_handler  klass  ) 

Function returns number of methods for current class.

Parameters:
klass - class handler
Returns:
Number of methods for class.
Note:
Assertion is raised if klass is equal to null.

method_handler class_get_method ( class_handler  klass,
unsigned short  index 
)

Function returns method of current class.

Parameters:
klass - class handler
index - method index
Returns:
Method handler.
Note:
Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_size ( class_handler  klass  ) 

Function returns class constant pool size.

Parameters:
klass - class handler
Returns:
constant pool size
Note:
Assertion is raised if klass is equal to null.

unsigned char class_get_cp_tag ( class_handler  klass,
unsigned short  index 
)

Function returns constant pool entry tag.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
constant pool entry tag
Note:
Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_class_name_index ( class_handler  klass,
unsigned short  index 
)

Function returns class name entry index in constant pool.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
class name entry index
Note:
Function is legal only for constant pool entry with CONSTANT_Class tags.

Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_ref_class_index ( class_handler  klass,
unsigned short  index 
)

Function returns class name entry index in constant pool.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
class name entry index
Note:
Function is legal for constant pool entry with CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.

Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_ref_name_and_type_index ( class_handler  klass,
unsigned short  index 
)

Function returns name_and_type entry index in constant pool.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
name_and_type entry index
Note:
Function is legal for constant pool entry with CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.

Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_string_index ( class_handler  klass,
unsigned short  index 
)

Function returns string entry index in constant pool.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
string entry index
Note:
Function is legal for constant pool entry with CONSTANT_String tags.

Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_name_index ( class_handler  klass,
unsigned short  index 
)

Function returns name entry index in constant pool.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
name entry index
Note:
Function is legal for constant pool entry with CONSTANT_NameAndType tags.

Assertion is raised if klass is equal to null or index is out of range.

unsigned short class_get_cp_descriptor_index ( class_handler  klass,
unsigned short  index 
)

Function returns descriptor entry index in constant pool.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
descriptor entry index
Note:
Function is legal for constant pool entry with CONSTANT_NameAndType tags.

Assertion is raised if klass is equal to null or index is out of range.

const char* class_get_cp_utf8_bytes ( class_handler  klass,
unsigned short  index 
)

Function returns bytes for UTF8 constant pool entry.

Parameters:
klass - class handler
index - constant pool entry index
Returns:
bytes for UTF8 constant pool entry
Note:
Function is legal for constant pool entry with CONSTANT_UTF8 tags.

Assertion is raised if klass is equal to null or index is out of range.

void class_set_verify_data_ptr ( class_handler  klass,
void *  data 
)

Function sets verify data to a given class.

Parameters:
klass - class handler
data - verify data
Note:
Assertion is raised if class is equal to null.

Function makes non thread save operation and must be called in thread safe point.

void* class_get_verify_data_ptr ( class_handler  klass  ) 

Function returns verify data for a given class.

Parameters:
klass - class handler
Returns:
Verify data for a given class.
Note:
Assertion is raised if klass is equal to null.

method_handler class_resolve_method ( class_handler  klass,
unsigned short  index 
)

Function resolves class nonstatic method for constant pool entry.

Parameters:
klass - class handle
index - constant pool entry index
exc - pointer to exception
Returns:
Return nonstatic method resolved for constant pool entry.

field_handler class_resolve_nonstatic_field ( class_handler  klass,
unsigned short  index 
)

Function resolves class nonstatic field for constant pool entry.

Parameters:
klass - class handle
index - constant pool entry index
exc - pointer to exception
Returns:
Return nonstatic field resolved for constant pool entry.

class_handler method_get_class ( method_handler  hmethod  ) 

Function returns a class in which the method is declared.

Parameters:
method - method handler
Returns:
Return a class in which the method is declared.
Note:
Assertion is raised if method is equal to null.

const char* method_get_name ( method_handler  method  ) 

Function returns method name.

Parameters:
method - method handler
Returns:
Method name bytes.
Note:
Assertion is raised if method is equal to null.

const char* method_get_descriptor ( method_handler  method  ) 

Function returns method descriptor.

Parameters:
method - method handler
Returns:
Method descriptor bytes.
Note:
Assertion is raised if method is equal to null.

unsigned method_get_code_length ( method_handler  method  ) 

Function returns method code length.

Parameters:
method - method handler
Returns:
Method code length.
Note:
Assertion is raised if method is equal to null.

unsigned char* method_get_bytecode ( method_handler  method  ) 

Function returns method bytecode array.

Parameters:
method - method handler
Returns:
Method bytecode array.
Note:
Assertion is raised if method is equal to null.

unsigned short method_get_max_local ( method_handler  method  ) 

Function returns maximal local variables number of method.

Parameters:
method - method handler
Returns:
Maximal local variables number of method.
Note:
Assertion is raised if method is equal to null.

unsigned short method_get_max_stack ( method_handler  method  ) 

Function returns maximal stack deep of method.

Parameters:
method - method handler
Returns:
Maximal stack deep of method.
Note:
Assertion is raised if method is equal to null.

unsigned method_is_static ( method_handler  method  ) 

Function checks if method is static.

Parameters:
method - method handler
Returns:
If method is static, function returns true, else returns false.
Note:
Assertion is raised if method is equal to null.

unsigned method_is_protected ( method_handler  method  ) 

Function checks if a given method is protected.

Parameters:
method - method handle
Returns:
Return TRUE if a given method is protected.
Note:
Assertion is raised if method is equal to null.

unsigned short method_get_exc_handler_number ( method_handler  method  ) 

Function returns number of method exception handlers.

Parameters:
method - method handler
Returns:
Number of method exception handlers.
Note:
Assertion is raised if method is equal to null.

void method_get_exc_handler_info ( method_handler  method,
unsigned short  index,
unsigned short *  start_pc,
unsigned short *  end_pc,
unsigned short *  handler_pc,
unsigned short *  catch_type 
)

Function obtains method exception handler info.

Parameters:
method - method handler
index - exception handler index number
start_pc - resulting pointer to exception handler start program count
end_pc - resulting pointer to exception handler end program count
handler_pc - resulting pointer to exception handler program count
catch_type - resulting pointer to constant pool entry index
Note:
Assertion is raised if method is equal to null or exception handler index is out of range or any pointer is equal to null.

unsigned short method_get_number_exc_method_can_throw ( method_handler  hmethod  ) 

Gets number of exceptions a method can throw.

Parameter hmethod must not equal to NULL.

Parameters:
hmethod method handle
Returns:
number of exceptions

const char* method_get_exc_method_can_throw ( method_handler  hmethod,
unsigned short  index 
)

Gets name of exception a method can throw.

Parameter hmethod must not equal to NULL. If parameter index is out of range, returns NULL.

Parameters:
hmethod method handle
index index of exception
Returns:
name of exception

unsigned char* method_get_stackmaptable ( method_handler  hmethod  ) 

Gets StackMapTable attribute.

Parameter hmethod must not equal to NULL. If parameter index is out of range, returns NULL.

Parameters:
hmethod method handle
Returns:
StackMapTable bytes

void cl_set_verify_data_ptr ( classloader_handler  classloader,
void *  data 
)

Function sets verify data in class loader.

Parameters:
classloader - class loader handler
data - verify data
Note:
Assertion is raised if classloader is equal to null.

Function makes non thread save operation and must be called in thread safe point.

void* cl_get_verify_data_ptr ( classloader_handler  classloader  ) 

Function returns verify data in class loader.

Parameters:
classloader - class loader handler
Returns:
Verify data in class loader.
Note:
Assertion is raised if classloader is equal to null.

void cl_acquire_lock ( classloader_handler  classloader  ) 

Function locks class loader.

Parameters:
classloader - class loader handler
Note:
Assertion is raised if classloader is equal to null.

void cl_release_lock ( classloader_handler  classloader  ) 

Function releases class loader.

Parameters:
classloader - class loader handler
Note:
Assertion is raised if classloader is equal to null.

class_handler cl_get_class ( classloader_handler  classloader,
const char *  name 
)

Function returns loaded class in class loader.

Parameters:
classloader - class loader handler
name - class name
Returns:
Loaded class in classloader or null if class isn't loaded in class loader.
Note:
Assertion is raised if classloader or name are equal to null.

class_handler cl_load_class ( classloader_handler  classloader,
const char *  name 
)

Function returns loaded class in class loader.

Parameters:
classloader - class loader handler
name - class name
Returns:
Loaded class in classloader if class isn't loaded in class loader function loads it.
Note:
Assertion is raised if classloader or name are equal to null.

unsigned field_is_protected ( field_handler  field  ) 

Function checks if the field is protected.

Parameters:
field - field handler
Returns:
Returns TRUE if the field is protected.


Genereated on Tue Mar 11 19:25:56 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.