indexing
	description: "Access to Java classes. Static methods and attributes are accessed via this class"

class interface
	JAVA_CLASS

create

feature 

	jni: JNI_ENVIRONMENT
			-- returns the standard JNI enviroment. It uses the value of
			-- CLASS_PATH environment variable to initialize the JVM
			-- (from SHARED_JNI_ENVIRONMENT)
		ensure -- from SHARED_JNI_ENVIRONMENT
			Result /= void

	name: STRING
			-- name of this class
	
feature -- Java exception mechanism

	c_check_for_exceptions (lenv: POINTER)
			-- (from JAVA_EXTERNALS)

	c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
			-- (from JAVA_EXTERNALS)

	c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
			-- (from JAVA_EXTERNALS)
	
feature -- Setting static attributes

	set_boolean_attribute (fid: POINTER; value: BOOLEAN)
			-- set a 'boolean' attribute to 'value'

	set_byte_attribute (fid: POINTER; value: CHARACTER)
			-- set a 'byte' attribute to 'value'

	set_char_attribute (fid: POINTER; value: CHARACTER)
			-- set a 'char' attribute to 'value'

	set_double_attribute (fid: POINTER; value: DOUBLE)
			-- set a 'double' attribute to 'value'

	set_float_attribute (fid: POINTER; value: REAL)
			-- set a 'float' attribute to 'value'

	set_integer_attribute (fid: POINTER; value: INTEGER)
			-- set an 'integer' attribute to 'value'

	set_object_attribute (fid: POINTER; value: JAVA_OBJECT)
			-- set a java object attribute to 'value'

	set_short_attribute (fid: POINTER; value: INTEGER)
			-- set a 'short' attribute to 'value'

	set_string_attribute (fid: POINTER; value: STRING)
			-- set a 'String' attribute to 'value'
	
feature -- access to static attributes

	boolean_attribute (fid: POINTER): BOOLEAN
			-- access to a boolean attribute

	byte_attribute (fid: POINTER): CHARACTER
			-- access to a 'byte' attribute, returns a CHARACTER

	char_attribute (fid: POINTER): CHARACTER
			-- access to a 'char' attribute

	double_attribute (fid: POINTER): DOUBLE
			-- access to a double attribute

	float_attribute (fid: POINTER): REAL
			-- access to a 'float' attribute, returns a REAL

	integer_attribute (fid: POINTER): INTEGER
			-- get a value of an integer static field

	object_attribute (fid: POINTER): JAVA_OBJECT
			-- get the value of OBJECT static field

	short_attribute (fid: POINTER): INTEGER
			-- access to a 'short' attribute, returns a INTEGER

	string_attribute (fid: POINTER): STRING
			-- get the value of STRING static field
	
feature -- attribute ids

	field_id (fname: STRING; sig: STRING): POINTER
			-- Get the java field id of a static field, used to set/get this field
		require -- from JAVA_OBJECT
			(lname /= void) and (sig /= void)
		require else
			(fname /= void) and (sig /= void)
	
feature -- call object's methods

	long_method (mid: POINTER; args: JAVA_ARGS)
			-- Call an instance function that returns an Long. This
			-- function is not implemented.
			-- (from JAVA_OBJECT)
	
feature -- calling static methods

	boolean_method (mid: POINTER; args: JAVA_ARGS): BOOLEAN
			-- Call a static function that returns a BOOLEAN.
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	byte_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
			-- Call a static function that returns a byte
			-- (represented as CHARACTER in Eiffel)
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	char_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
			-- Call a static function that returns a CHARACTER.
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	double_method (mid: POINTER; args: JAVA_ARGS): DOUBLE
			-- Call a static function that returns a DOUBLE.
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	float_method (mid: POINTER; args: JAVA_ARGS): REAL
			-- Call a static function that returns a REAL.
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	integer_method (mid: POINTER; args: JAVA_ARGS): INTEGER
			-- Call a static function that returns an INTEGER.
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	object_method (lmethod_id: POINTER; args: JAVA_ARGS): JAVA_OBJECT
			-- Call a static function that returns a JAVA_OBJECT. An
			-- Eiffl proxy object is returned.
		require -- from JAVA_OBJECT
			valid_method_id: lmethod_id /= default_pointer

	short_method (mid: POINTER; args: JAVA_ARGS): INTEGER
			-- Call a static function that returns a short
			-- (represented as INTEGER in Eiffel)
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	string_method (lmethod_id: POINTER; args: JAVA_ARGS): STRING
			-- Call static routine that returns a string
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer

	void_method (lmethod_id: POINTER; args: JAVA_ARGS)
			-- call static method with specific ID, passing arguments
		require -- from JAVA_OBJECT
			valid_method: mid /= default_pointer
	
feature -- creation

	make_from_pointer (jobject: POINTER)
			-- Create an Eiffel proxy, give a pointer to a Java object
			-- (Java object already exists)
			-- (from JAVA_OBJECT)
		require -- from JAVA_OBJECT
			valid_java_id: jobject /= default_pointer
	
feature -- method ids - in a Java class these are all static

	method_id (mname: STRING; sig: STRING): POINTER
			-- Return "method_id" for a static method with "mname" and
			-- signature "sig" that belongs to this class.
		require -- from JAVA_OBJECT
			(method_name /= void) and (signature /= void)
		ensure -- from JAVA_OBJECT
			method_exists: Result /= default_pointer
	
invariant

		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)
		-- from JAVA_OBJECT
	valid_proxy: java_class_id /= default_pointer

end -- class JAVA_CLASS